git.iko.soy/distributed-process
on master help sign in
Make testTerminate time-insensitive.
commit140d332dc8fb23bb62a5eb904c78359fe5d1d718 authorFacundo Domínguez <facundo.dominguez@tweag.io> dateFri 10 Jun 2016, 10:13 (10 years ago) parenta056ea7
1 file changed+3−12
distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs+3−12
distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs+3−12
@@ -560,19 +560,10 @@ testMergeChannels TestTransport{..} = do
560560testTerminate :: TestTransport -> Assertion
561561testTerminate TestTransport{..} = do
562562 localNode <- newLocalNode testTransport initRemoteTable
563− done <- newEmptyMVar
564−
565− pid <- forkProcess localNode $ do
566− liftIO $ threadDelay 100000
567− terminate
568−
569563 runProcess localNode $ do
570− ref <- monitor pid
571− ProcessMonitorNotification ref' pid' (DiedException ex) <- expect
572− True <- return $ ref == ref' && pid == pid' && ex == show ProcessTerminationException
573− liftIO $ putMVar done ()
574−
575− takeMVar done
564+ e <- try terminate :: Process (Either ProcessTerminationException ())
565+ True <- return $ either show show e == show ProcessTerminationException
566+ return ()
576567
577568testMonitorNode :: TestTransport -> Assertion
578569testMonitorNode TestTransport{..} = do