Skip to content

Commit 140d332

Browse files
Make testTerminate time-insensitive.
1 parent a056ea7 commit 140d332

File tree

1 file changed

+3
-12
lines changed
  • distributed-process-tests/src/Control/Distributed/Process/Tests

1 file changed

+3
-12
lines changed

distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -560,19 +560,10 @@ testMergeChannels TestTransport{..} = do
560560
testTerminate :: TestTransport -> Assertion
561561
testTerminate 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

577568
testMonitorNode :: TestTransport -> Assertion
578569
testMonitorNode TestTransport{..} = do

0 commit comments

Comments
 (0)