Skip to content

Commit 059d21f

Browse files
authored
fix: explicitly join coroutines in failing http client engine test (#942)
1 parent cacd325 commit 059d21f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

runtime/protocol/http-client/common/test/aws/smithy/kotlin/runtime/http/engine/HttpClientEngineTest.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,13 +129,13 @@ class HttpClientEngineTest {
129129
@Test
130130
fun testShutdownOnlyAfterInFlightDone() = runTest {
131131
val waiter = Channel<Unit>(1)
132-
launch {
132+
val job1 = launch {
133133
val call = client.call(SdkHttpRequest(HttpRequestBuilder()))
134134
waiter.receive()
135135
call.complete()
136136
}
137137
yield()
138-
launch {
138+
val job2 = launch {
139139
val call = client.call(SdkHttpRequest(HttpRequestBuilder()))
140140
waiter.receive()
141141
call.complete()
@@ -155,6 +155,7 @@ class HttpClientEngineTest {
155155
waiter.send(Unit)
156156
yield()
157157

158+
joinAll(job1, job2)
158159
assertFalse(engine.coroutineContext.job.isActive)
159160
assertTrue(engine.shutdownCalled)
160161
}

0 commit comments

Comments
 (0)