Skip to content

Commit

Permalink
Use loopback address for testrunner comms. (#912)
Browse files Browse the repository at this point in the history
(fixes #911)
  • Loading branch information
cbrunnkvist authored Jul 21, 2021
1 parent c276535 commit 3ddecfe
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 @@ -3,7 +3,7 @@ package stryker4s.sbt.testrunner
import stryker4s.api.testprocess.Request

import java.io.{ObjectInputStream, ObjectOutputStream}
import java.net.{ServerSocket, Socket}
import java.net.{InetAddress, ServerSocket, Socket}

object SbtTestRunnerMain {
def main(args: Array[String]): Unit = {
Expand All @@ -14,7 +14,7 @@ object SbtTestRunnerMain {

private def setupSocketServer(port: Int) = {
println(s"Setting up server on port $port")
val server = new ServerSocket(port)
val server = new ServerSocket(port, 0, InetAddress.getLoopbackAddress)
try {
val socket = server.accept()
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ object ProcessTestRunner extends TestInterfaceMapper {
Resource
.make(
retryWithBackoff(5, 0.5.seconds, log.info("Could not connect to testprocess. Retrying..."))(
IO(new Socket(InetAddress.getLocalHost(), port))
IO(new Socket(InetAddress.getLoopbackAddress(), port))
)
)(s => IO(log.debug(s"Closing test-runner on port $port")) *> IO(s.close()))
.evalTap(_ => IO(log.debug("Created socket")))
Expand Down

0 comments on commit 3ddecfe

Please sign in to comment.