@@ -92,7 +92,7 @@ class ConnectionTestLinux : ConnectionTest() {
9292 }
9393
9494 @Test
95- fun `simultaneous ws and http request with a single http client will hang ` () = doTest {
95+ fun `simultaneous ws and http request with a single http client will also work ` () = doTest {
9696 val config: HttpClientConfig <* >.() -> Unit = {
9797 install(io.ktor.client.plugins.logging.Logging ) {
9898 logger = object : Logger {
@@ -110,7 +110,9 @@ class ConnectionTestLinux : ConnectionTest() {
110110 config(this )
111111 }
112112
113- assertFailsWith<TimeoutCancellationException > {
113+ var pollRes = " "
114+ // ktor 3.2.0 fix the problem
115+ // assertFailsWith<TimeoutCancellationException> {
114116 withContext(Dispatchers .Default ) {
115117 withTimeout(5000 ) {
116118 client.webSocket(" ws://localhost:3000/socket.io/?EIO=4&transport=websocket" , {}) {
@@ -126,8 +128,8 @@ class ConnectionTestLinux : ConnectionTest() {
126128 }
127129 Logging .info(TAG , " http response status: ${resp.status} " )
128130 if (resp.status.isSuccess()) {
129- val body = resp.bodyAsText()
130- Logging .info(TAG , " http response body: $body " )
131+ pollRes = resp.bodyAsText()
132+ Logging .info(TAG , " http response body: $pollRes " )
131133 break
132134 }
133135 } catch (e: Exception ) {
@@ -138,6 +140,9 @@ class ConnectionTestLinux : ConnectionTest() {
138140 }
139141 }
140142 }
141- }
143+ // }
144+
145+ val pkt = EngineIO .decodeHttpBatch(pollRes, SocketIO ::decode)[0 ]
146+ assertTrue(pkt is EngineIOPacket .Open )
142147 }
143148}
0 commit comments