You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Following test just hangs. This issue could be similar to #745.
@Test
funtestConversation() {
withTestApplication {
application.install(WebSockets)
application.install(StatusPages) // <-- I added only thisval received = arrayListOf<String>()
application.routing {
webSocket("/echo") {
try {
while (true) {
val text = (incoming.receive() asFrame.Text).readText()
received += text
outgoing.send(Frame.Text(text))
}
} catch (e:ClosedReceiveChannelException) {
// Do nothing!
} catch (e:Throwable) {
e.printStackTrace()
}
}
}
handleWebSocketConversation("/echo") { incoming, outgoing ->val textMessages =listOf("HELLO", "WORLD")
for (msg in textMessages) {
outgoing.send(Frame.Text(msg))
assertEquals(msg, (incoming.receive() asFrame.Text).readText())
}
assertEquals(textMessages, received)
}
}
}
Versions
Ktor: 1.1.1
Java: openJDK 11.0.1
Kotlin: 1.3.11
Coroutines: 1.1.0
Ktor Engine Used(client or server and name)
Test engine.
Thread dump
"Test worker" #13 prio=5 os_prio=0 cpu=355.78ms elapsed=20.86s tid=0x00007f9344b56000 nid=0x5c4c waiting on condition [0x00007f92ff095000]
java.lang.Thread.State: WAITING (parking)
at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
- parking to wait for <0x000000062dd27610> (a java.util.concurrent.CompletableFuture$Signaller)
at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
at java.util.concurrent.CompletableFuture$Signaller.block([email protected]/CompletableFuture.java:1796)
at java.util.concurrent.ForkJoinPool.managedBlock([email protected]/ForkJoinPool.java:3128)
at java.util.concurrent.CompletableFuture.waitingGet([email protected]/CompletableFuture.java:1823)
at java.util.concurrent.CompletableFuture.join([email protected]/CompletableFuture.java:2043)
at io.ktor.server.testing.TestApplicationEngine.handleWebSocket(TestApplicationEngine.kt:145)
at io.ktor.server.testing.TestApplicationEngine.handleWebSocketConversation(TestApplicationEngine.kt:160)
at io.ktor.server.testing.TestApplicationEngine.handleWebSocketConversation$default(TestApplicationEngine.kt:156)
at com.neworldwar.backend.controller.ChatControllerTest$testConversation$1.invoke(ChatControllerTest.kt:57)
Following test just hangs. This issue could be similar to #745.
Versions
Ktor Engine Used(client or server and name)
Test engine.
Thread dump
Full: https://gist.github.com/neworld/ffb5e2792870b6b4c7b72e7d70d8ba57
The text was updated successfully, but these errors were encountered: