We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5e03ca2 commit ea8677dCopy full SHA for ea8677d
kotlinx-coroutines-test/common/src/TestBuilders.kt
@@ -340,9 +340,13 @@ public fun TestScope.runTest(
340
var message = "After waiting for $timeout"
341
if (completionCause == null)
342
message += ", the test coroutine is not completing"
343
- if (activeChildren.isNotEmpty())
+ if (activeChildren.isNotEmpty()) {
344
message += ", there were active child jobs: $activeChildren"
345
- if (completionCause != null && activeChildren.isEmpty()) {
+ if (completionCause != null) {
346
+ message += ". Use `TestScope.backgroundScope` " +
347
+ "to launch the coroutines that need to be cancelled when the test body finishes"
348
+ }
349
+ } else if (completionCause != null) {
350
message += if (scope.isCompleted)
351
", the test coroutine completed"
352
else
0 commit comments