Repository: kotest/kotest (kotlin)

Issue:
Older version of coroutines breaks WasmJS execution on Kotlin 2.1.0
**Which version of Kotest are you using**
6.0.0.M1

**Problem**
When working on WASM JS tests, I stumbled upon a problem with timeouting WASM JS browser tests:
```
> Task :wasmJsBrowserTest
Disconnected (0 times) , because no message in 30000 ms.
java.lang.IllegalStateException: command '/home/runner/.gradle/nodejs/node-v22.0.0-linux-x64/bin/node' exited with errors (exit code: 1)
```

With the support of the Kotlin team, we found out it's because kotest depends on an old version of coroutines:
https://github.com/kotest/kotest/blob/09d013c0021a26a6f20a90d03dc5551b2bf131fa/gradle/libs.versions.toml#L13

and the tests work fine on e.g. coroutines 1.10.1 which were built with the latest Kotlin version (2.1.0).

A workaround looks like this:
```
commonTest {
  dependencies {
    //....
    runtimeOnly("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.1")
  }
}
```

Pull request:
Fixes #4644

Patch:
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index 3e645aba670..7cdbee7fdaa 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -11,7 +11,7 @@ junit-platform = "1.8.2"
 junit-jupiter = "5.8.2"
 kaml = "0.66.0"
 kotlin = "2.1.0"
-kotlinx-coroutines = "1.8.0"
+kotlinx-coroutines = "1.10.0"
 kotlinx-serialization = "1.6.3"
 ktor = "2.3.13"
 mockk = "1.13.14"


Test patch:
diff --git a/kotest-assertions/kotest-assertions-core/src/jvmTest/kotlin/com/sksamuel/kotest/matchers/file/FileMatchersTest.kt b/kotest-assertions/kotest-assertions-core/src/jvmTest/kotlin/com/sksamuel/kotest/matchers/file/FileMatchersTest.kt
index dab8833bae9..a98cbc142df 100644
--- a/kotest-assertions/kotest-assertions-core/src/jvmTest/kotlin/com/sksamuel/kotest/matchers/file/FileMatchersTest.kt
+++ b/kotest-assertions/kotest-assertions-core/src/jvmTest/kotlin/com/sksamuel/kotest/matchers/file/FileMatchersTest.kt
@@ -18,8 +18,8 @@ import io.kotest.matchers.file.shouldBeSymbolicLink
 import io.kotest.matchers.file.shouldExist
 import io.kotest.matchers.file.shouldHaveExtension
 import io.kotest.matchers.file.shouldHaveParent
-import io.kotest.matchers.file.shouldHaveSameStructureAs
 import io.kotest.matchers.file.shouldHaveSameStructureAndContentAs
+import io.kotest.matchers.file.shouldHaveSameStructureAs
 import io.kotest.matchers.file.shouldNotBeADirectory
 import io.kotest.matchers.file.shouldNotBeAFile
 import io.kotest.matchers.file.shouldNotBeEmptyDirectory
@@ -46,10 +46,10 @@ import io.kotest.matchers.shouldBe
 import io.kotest.matchers.shouldNot
 import io.kotest.matchers.string.shouldEndWith
 import io.kotest.matchers.string.shouldMatch
+import org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS
 import java.io.File
 import java.nio.file.Files
 import java.nio.file.Paths
-import org.apache.commons.lang3.SystemUtils.IS_OS_WINDOWS
 import kotlin.io.path.writeBytes
 
 @Suppress("BlockingMethodInNonBlockingContext")
diff --git a/kotest-framework/kotest-framework-engine/build.gradle.kts b/kotest-framework/kotest-framework-engine/build.gradle.kts
index 353d4859889..522a32b6795 100644
--- a/kotest-framework/kotest-framework-engine/build.gradle.kts
+++ b/kotest-framework/kotest-framework-engine/build.gradle.kts
@@ -13,8 +13,6 @@ kotlin {
             implementation(kotlin("reflect"))
             api(projects.kotestCommon) // needs to be API so the domain objects are open
 
-            // used to install the debug probes for coroutines
-            api(libs.kotlinx.coroutines.debug)
             api(libs.kotlinx.coroutines.core)
             // used for the test scheduler
             implementation(libs.kotlinx.coroutines.test)
@@ -29,6 +27,9 @@ kotlin {
 
             // used to write to the console with fancy colours!
             api(libs.mordant)
+
+            // used to install the debug probes for coroutines
+            api(libs.kotlinx.coroutines.debug)
          }
       }
 
diff --git a/kotest-framework/kotest-framework-engine/src/commonMain/kotlin/io/kotest/engine/test/interceptors/CoroutineDebugProbeInterceptor.kt b/kotest-framework/kotest-framework-engine/src/commonMain/kotlin/io/kotest/engine/test/interceptors/CoroutineDebugProbeInterceptor.kt
index 5b0b9611517..1245b494298 100644
--- a/kotest-framework/kotest-framework-engine/src/commonMain/kotlin/io/kotest/engine/test/interceptors/CoroutineDebugProbeInterceptor.kt
+++ b/kotest-framework/kotest-framework-engine/src/commonMain/kotlin/io/kotest/engine/test/interceptors/CoroutineDebugProbeInterceptor.kt
@@ -1,5 +1,6 @@
 package io.kotest.engine.test.interceptors
 
+import io.kotest.common.JVMOnly
 import io.kotest.core.Logger
 import io.kotest.core.test.TestCase
 import io.kotest.core.test.TestResult
@@ -11,6 +12,7 @@ import io.kotest.engine.config.TestConfigResolver
  * If configured, then the kotlinx debug probe is installed for coroutines.
  * Note: This is a JVM only option.
  */
+@JVMOnly
 internal class CoroutineDebugProbeInterceptor(
    private val testConfigResolver: TestConfigResolver,
 ) : TestExecutionInterceptor {
diff --git a/kotest-framework/kotest-framework-engine/src/jvmTest/kotlin/com/sksamuel/kotest/engine/test/timeout/ContainerTimeoutTest.kt b/kotest-framework/kotest-framework-engine/src/jvmTest/kotlin/com/sksamuel/kotest/engine/test/timeout/ContainerTimeoutTest.kt
index 4e99b4a4e5c..28a65a34ccf 100644
--- a/kotest-framework/kotest-framework-engine/src/jvmTest/kotlin/com/sksamuel/kotest/engine/test/timeout/ContainerTimeoutTest.kt
+++ b/kotest-framework/kotest-framework-engine/src/jvmTest/kotlin/com/sksamuel/kotest/engine/test/timeout/ContainerTimeoutTest.kt
@@ -21,7 +21,7 @@ class ContainerTimeoutTest : FunSpec() {
          withData(
             nameFn = { (coroutineTestScope, message) -> "coroutineTestScope = $coroutineTestScope -> $message" },
             false to "Test 'a' did not complete within 100ms",
-            true to "After waiting for 100ms, the test coroutine is not completing, there were active child jobs",
+            true to "After waiting for 100ms, the test body did not run to completion",
          ) { (enableCoroutineTestScope, message) ->
             val collector = CollectingTestEngineListener()
             val c = object : AbstractProjectConfig() {