1-- Run tests using the TCP transport.
5import TEST_SUITE_MODULE (tests)
7import Network.Transport.Test (TestTransport(..))
8import Network.Socket (sClose)
9import Network.Transport.TCP
10 ( createTransportExposeInternals
11 , TransportInternals(socketBetween)
12 , defaultTCPParameters
16import Test.Framework (defaultMainWithArgs)
18import Control.Concurrent (threadDelay)
19import Control.Exception (IOException, try)
20import System.Environment (getArgs)
25 hSetBuffering stdout LineBuffering
26 hSetBuffering stderr LineBuffering
27 Right (transport, internals) <-
28 createTransportExposeInternals (defaultTCPAddr "127.0.0.1" "8080")
29 defaultTCPParameters { transportConnectTimeout = Just 3000000 }
30 ts <- tests TestTransport
31 { testTransport = transport
32 , testBreakConnection = \addr1 addr2 -> do
33 esock <- try $ socketBetween internals addr1 addr2
34 either (\e -> const (return ()) (e :: IOException)) sClose esock
38 -- Tests are time sensitive. Running the tests concurrently can slow them
39 -- down enough that threads using threadDelay would wake up later than
40 -- expected, thus changing the order in which messages were expected.
41 -- Therefore we run the tests sequentially by passing "-j 1" to
42 -- test-framework. This does not solve the issue but makes it less likely.
44 -- The problem was first detected with
45 -- 'Control.Distributed.Process.Tests.CH.testMergeChannels'
47 defaultMainWithArgs ts ("-j" : "1" : args)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list