git.iko.soy/distributed-process
on master help sign in
d-p-tests: Set timeout when creating connections when testing with TCP.

This is necessary so the transport considers connections failed when they remain silent for a while.

commitc1e565b0d618b7f4db569c5e8b88d335597919ef authorFacundo Domínguez <facundo.dominguez@tweag.io> dateTue 16 Feb 2016, 10:37 (11 years ago) parent96dbb86
2 files changed+4−2
distributed-process-tests/distributed-process-tests.cabal+1−1 distributed-process-tests/tests/runTCP.hs+3−1
distributed-process-tests/distributed-process-tests.cabal+1−1
@@ -78,7 +78,7 @@ Test-Suite TestCHInTCP
7878 distributed-process-tests,
7979 network >= 2.3 && < 2.7,
8080 network-transport >= 0.4.1.0 && < 0.5,
81− network-transport-tcp >= 0.3 && < 0.6,
81+ network-transport-tcp >= 0.5 && < 0.6,
8282 test-framework >= 0.6 && < 0.9
8383 else
8484 Buildable: False
distributed-process-tests/tests/runTCP.hs+3−1
@@ -10,6 +10,7 @@ import Network.Transport.TCP
1010 ( createTransportExposeInternals
1111 , TransportInternals(socketBetween)
1212 , defaultTCPParameters
13+ , TCPParameters(..)
1314 )
1415import Test.Framework (defaultMainWithArgs)
1516
@@ -19,7 +20,8 @@ import System.Environment (getArgs)
1920main :: IO ()
2021main = do
2122 Right (transport, internals) <-
22− createTransportExposeInternals "127.0.0.1" "8080" defaultTCPParameters
23+ createTransportExposeInternals "127.0.0.1" "8080"
24+ defaultTCPParameters { transportConnectTimeout = Just 3000000 }
2325 ts <- tests TestTransport
2426 { testTransport = transport
2527 , testBreakConnection = \addr1 addr2 -> do