Skip to content

Commit e28ff2e

Browse files
committed
Fix race in tests
1 parent a1463ba commit e28ff2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

kotlinx-coroutines-core/jvm/test/flow/CallbackFlowTest.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class CallbackFlowTest : TestBase() {
4141

4242
val flow = channelFlow<Int>(16) {
4343
api.start(channel)
44-
channel.invokeOnClose {
44+
awaitClose {
4545
api.stop()
4646
}
4747
}
@@ -85,7 +85,7 @@ class CallbackFlowTest : TestBase() {
8585

8686
val flow = channelFlow<Int> {
8787
api.start(channel)
88-
channel.invokeOnClose {
88+
awaitClose {
8989
api.stop()
9090
}
9191
}

0 commit comments

Comments
 (0)