on master help sign in
test uses 127.0.0.1 only (fix #281).
commite1366da499ec9addeebdf9fedbcea0f5df4fb13a authorKazu Yamamoto <kazu@iij.ad.jp> dateMon 11 Aug 2014, 16:58 (12 years ago) parentd0f3c29
2 files changed+3−2
warp/test/ExceptionSpec.hs+1−1 warp/test/RunSpec.hs+2−1
warp/test/ExceptionSpec.hs+1−1
@@ -21,7 +21,7 @@ main = hspec spec
2121
2222withTestServer :: (Int -> IO a) -> IO a
2323withTestServer inner = bracket
24− (N.bindRandomPortTCP "*4")
24+ (N.bindRandomPortTCP "127.0.0.1")
2525 (sClose . snd)
2626 $ \(prt, lsocket) -> do
2727 withAsync (runSettingsSocket defaultSettings lsocket testApp)
warp/test/RunSpec.hs+2−1
@@ -79,7 +79,7 @@ nextPort = unsafePerformIO $ I.newIORef 5000
7979getPort :: IO Int
8080getPort = do
8181 port <- I.atomicModifyIORef nextPort $ \p -> (p + 1, p)
82− esocket <- try $ bindPortTCP port "*4"
82+ esocket <- try $ bindPortTCP port "127.0.0.1"
8383 case esocket of
8484 Left (_ :: IOException) -> RunSpec.getPort
8585 Right socket -> do
@@ -91,6 +91,7 @@ withApp settings app f = do
9191 port <- RunSpec.getPort
9292 baton <- newEmptyMVar
9393 let settings' = setPort port
94+ $ setHost "127.0.0.1"
9495 $ setBeforeMainLoop (putMVar baton ())
9596 settings
9697 bracket