git.iko.soy/distributed-process
on master help sign in
Add a test for 'timeout'
0e3fa94Edsko de Vries
distributed-process/tests/TestCH.hs+8
@@ -295,6 +295,13 @@ testMath transport = do
295
295
296 takeMVar clientDone
296 takeMVar clientDone
297
297
298+testTimeout :: NT.Transport -> IO ()
299+testTimeout transport = do
300+ localNode <- newLocalNode transport initRemoteTable
301+ runProcess localNode $ do
302+ Nothing <- receiveTimeout 1000000 [match (\(Add _ _ _) -> return ())]
303+ return ()
304+
298-- TODO: test timeout
305-- TODO: test timeout
299
306
300main :: IO ()
307main :: IO ()
@@ -303,6 +310,7 @@ main = do
303 runTests
310 runTests
304 [ ("Ping", testPing transport)
311 [ ("Ping", testPing transport)
305 , ("Math", testMath transport)
312 , ("Math", testMath transport)
313+ , ("Timeout", testTimeout transport)
306 -- The "missing" combinations in the list below don't make much sense, as
314 -- The "missing" combinations in the list below don't make much sense, as
307 -- we cannot guarantee that the monitor reply or link exception will not
315 -- we cannot guarantee that the monitor reply or link exception will not
308 -- happen before the unmonitor or unlink
316 -- happen before the unmonitor or unlink