Skip to content

Commit 09cb4bf

Browse files
dkhalanskyjbqwwdfsad
authored andcommitted
Fix tests hanging when verifyDump fails
`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.
1 parent cf5da1a commit 09cb4bf

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

Diff for: kotlinx-coroutines-debug/test/RunningThreadStackMergeTest.kt

+9-6
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ class RunningThreadStackMergeTest : DebugTestBase() {
3333
"\t(Coroutine creation stacktrace)\n" +
3434
"\tat kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:116)",
3535
ignoredCoroutine = ":BlockingCoroutine"
36-
)
37-
coroutineBlocker.await()
36+
) {
37+
coroutineBlocker.await()
38+
}
3839
}
3940

4041
private fun awaitCoroutineStarted() {
@@ -87,8 +88,9 @@ class RunningThreadStackMergeTest : DebugTestBase() {
8788
"\t(Coroutine creation stacktrace)\n" +
8889
"\tat kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:116)",
8990
ignoredCoroutine = ":BlockingCoroutine"
90-
)
91-
coroutineBlocker.await()
91+
) {
92+
coroutineBlocker.await()
93+
}
9294
}
9395

9496
private fun CoroutineScope.launchEscapingCoroutine() {
@@ -125,8 +127,9 @@ class RunningThreadStackMergeTest : DebugTestBase() {
125127
"\t(Coroutine creation stacktrace)\n" +
126128
"\tat kotlin.coroutines.intrinsics.IntrinsicsKt__IntrinsicsJvmKt.createCoroutineUnintercepted(IntrinsicsJvm.kt:116)",
127129
ignoredCoroutine = ":BlockingCoroutine"
128-
)
129-
coroutineBlocker.await()
130+
) {
131+
coroutineBlocker.await()
132+
}
130133
}
131134

132135
private fun CoroutineScope.launchEscapingCoroutineWithoutContext() {

0 commit comments

Comments
 (0)