Skip to content

Commit

Permalink
use "127.0.0.1" instead of "0.0.0.0" in ktor tcp server tests because…
Browse files Browse the repository at this point in the history
… of mingw/windows behaviour
  • Loading branch information
whyoleg committed Dec 1, 2024
1 parent a1eab49 commit 6ad5287
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import kotlin.test.*
class TcpServerTest : SuspendTest {
private val testJob = Job()
private val testContext = testJob + TestExceptionHandler
private val serverTransport = KtorTcpServerTransport(testContext).target()
private val serverTransport = KtorTcpServerTransport(testContext).target("127.0.0.1")
private fun KtorTcpServerInstance.clientTransport() =
KtorTcpClientTransport(testContext).target(localAddress)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import kotlinx.coroutines.*
@Suppress("DEPRECATION_ERROR")
class TcpTransportTest : TransportTest() {
override suspend fun before() {
val serverSocket = startServer(TcpServerTransport()).serverSocket.await()
val serverSocket = startServer(TcpServerTransport("127.0.0.1")).serverSocket.await()
client = connectClient(TcpClientTransport(serverSocket.localAddress as InetSocketAddress, testContext))
}
}
Expand All @@ -36,7 +36,7 @@ class KtorTcpTransportTest : TransportTest() {
override suspend fun before() {
val server = startServer(KtorTcpServerTransport(testContext) {
selectorManager(selector, false)
}.target())
}.target("127.0.0.1"))
client = connectClient(KtorTcpClientTransport(testContext) {
selectorManager(selector, false)
}.target(server.localAddress))
Expand Down

0 comments on commit 6ad5287

Please sign in to comment.