Skip to content

Commit

Permalink
Fix tests hanging when verifyDump fails
Browse files Browse the repository at this point in the history
`runBlocking` waits for all the threads it spawned to finish, so
if `verifyDump` failed in `RunningThreadStackMergeTest.kt`, the
tests would just hang: one of the threads would wait for a
barrier to break, which would never happen.
  • Loading branch information
dkhalanskyjb authored and qwwdfsad committed Feb 6, 2020
1 parent cf5da1a commit 09cb4bf
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions kotlinx-coroutines-debug/test/RunningThreadStackMergeTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ class RunningThreadStackMergeTest : DebugTestBase() {
"\t(Coroutine creation stacktrace)\n" +
"\tat kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:116)",
ignoredCoroutine = ":BlockingCoroutine"
)
coroutineBlocker.await()
) {
coroutineBlocker.await()
}
}

private fun awaitCoroutineStarted() {
Expand Down Expand Up @@ -87,8 +88,9 @@ class RunningThreadStackMergeTest : DebugTestBase() {
"\t(Coroutine creation stacktrace)\n" +
"\tat kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:116)",
ignoredCoroutine = ":BlockingCoroutine"
)
coroutineBlocker.await()
) {
coroutineBlocker.await()
}
}

private fun CoroutineScope.launchEscapingCoroutine() {
Expand Down Expand Up @@ -125,8 +127,9 @@ class RunningThreadStackMergeTest : DebugTestBase() {
"\t(Coroutine creation stacktrace)\n" +
"\tat kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:116)",
ignoredCoroutine = ":BlockingCoroutine"
)
coroutineBlocker.await()
) {
coroutineBlocker.await()
}
}

private fun CoroutineScope.launchEscapingCoroutineWithoutContext() {
Expand Down

0 comments on commit 09cb4bf

Please sign in to comment.