Skip to content

Commit 660d554

Browse files
committed
See if blocking on registration still times out on travis...
1 parent c04f637 commit 660d554

File tree

2 files changed

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

2 files changed

+12
-11
lines changed

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

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1556,22 +1556,24 @@ testRegistryMonitoring :: TestTransport -> Assertion
15561556
testRegistryMonitoring TestTransport{..} = do
15571557
node1 <- newLocalNode testTransport initRemoteTable
15581558
node2 <- newLocalNode testTransport initRemoteTable
1559-
waitH <- newEmptyMVar
15601559

15611560
let nid = localNodeId node2
15621561
pid <- forkProcess node1 $ do
15631562
self <- getSelfPid
15641563
runUntilRegistered nid self
1565-
say $ regName ++ " registered to " ++ show self
1566-
liftIO $ takeMVar waitH
1564+
say $ (show self) ++ " registered as " ++ regName
1565+
expect :: Process ()
1566+
say $ (show self) ++ " exiting normally"
15671567

15681568
runProcess node2 $ do
15691569
register regName pid
1570+
say $ regName ++ " registered to " ++ show pid
15701571
res <- whereis regName
1572+
send pid ()
1573+
say $ " sent finish signal to " ++ show pid
15711574
us <- getSelfPid
1572-
liftIO $ do
1573-
putMVar waitH ()
1574-
assertBool "expected (Just pid)" $ res == (Just pid)
1575+
liftIO $ assertBool "expected (Just pid)" $ res == (Just pid)
1576+
15751577

15761578
-- This delay isn't essential!
15771579
-- The test case passes perfectly fine without it (feel free to comment out
@@ -1610,11 +1612,13 @@ testRegistryMonitoring TestTransport{..} = do
16101612

16111613
delayUntilMaybeUnregistered nid p = do
16121614
whereisRemoteAsync nid regName
1613-
receiveTimeout 20000000 {- 20 sec delay -} [
1615+
res <- receiveTimeout 20000000 {- 20 sec delay -} [
16141616
matchIf (\(WhereIsReply n p) -> n == regName && isNothing p)
16151617
(const $ return ())
16161618
]
1617-
return ()
1619+
case res of
1620+
Just () -> return ()
1621+
Nothing -> delayUntilMaybeUnregistered nid p
16181622

16191623
regName = "testRegisterRemote"
16201624

untilfail

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)