From d1c78b62dabd8cccfec70e1d50faefb7db1f3943 Mon Sep 17 00:00:00 2001 From: Bruce Hamilton Date: Tue, 30 Apr 2024 11:24:46 +0200 Subject: [PATCH] fixup! KTOR-6909 Add SocketTimeout for Test Engine (#4021) --- .../src/io/ktor/server/testing/client/TestHttpClientEngine.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ktor-server/ktor-server-test-host/jvmAndNix/src/io/ktor/server/testing/client/TestHttpClientEngine.kt b/ktor-server/ktor-server-test-host/jvmAndNix/src/io/ktor/server/testing/client/TestHttpClientEngine.kt index ae7a2c6c46a..32e12aa6a30 100644 --- a/ktor-server/ktor-server-test-host/jvmAndNix/src/io/ktor/server/testing/client/TestHttpClientEngine.kt +++ b/ktor-server/ktor-server-test-host/jvmAndNix/src/io/ktor/server/testing/client/TestHttpClientEngine.kt @@ -114,7 +114,9 @@ class TestHttpClientEngine(override val config: TestHttpClientConfig) : HttpClie } } - private fun OutgoingContent.toByteReadChannel(timeoutAttributes: HttpTimeout.HttpTimeoutCapabilityConfiguration?): ByteReadChannel = + private fun OutgoingContent.toByteReadChannel( + timeoutAttributes: HttpTimeout.HttpTimeoutCapabilityConfiguration? + ): ByteReadChannel = when (this) { is OutgoingContent.NoContent -> ByteReadChannel.Empty is OutgoingContent.ByteArrayContent -> ByteReadChannel(bytes())