Skip to content

Commit 8ae9c99

Browse files
committed
Replace ensureServerRunning with .start(wait = true)
1 parent b131cd2 commit 8ae9c99

File tree

2 files changed

+1
-19
lines changed
  • runtime/protocol
    • http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt
    • http-test/jvmAndNative/src/aws/smithy/kotlin/runtime/httptest

2 files changed

+1
-19
lines changed

runtime/protocol/http-client-engines/http-client-engine-crt/jvmAndNative/test/aws/smithy/kotlin/runtime/http/engine/crt/AsyncStressTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class AsyncStressTest : TestWithLocalServer() {
3434
call.respondText(text.repeat(respSize / text.length))
3535
}
3636
}
37-
}
37+
}.start(wait = true)
3838

3939
@Test
4040
fun testStreamNotConsumed() = runBlocking {

runtime/protocol/http-test/jvmAndNative/src/aws/smithy/kotlin/runtime/httptest/TestWithLocalServer.kt

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ public abstract class TestWithLocalServer {
4444
delay(250L * attempt)
4545
}
4646
} while (true)
47-
48-
ensureServerRunning()
4947
}
5048
}
5149

@@ -54,20 +52,4 @@ public abstract class TestWithLocalServer {
5452
server.stop(0, 0)
5553
println("test server stopped")
5654
}
57-
58-
private suspend fun ensureServerRunning() {
59-
val client = HttpClient()
60-
try {
61-
do {
62-
try {
63-
val response: HttpResponse = client.get("http://localhost:$serverPort")
64-
if (response.status.isSuccess()) break
65-
} catch (_: IOException) {
66-
delay(100.milliseconds)
67-
}
68-
} while (true)
69-
} finally {
70-
client.close()
71-
}
72-
}
7355
}

0 commit comments

Comments
 (0)