git.iko.soy/distributed-process
on master help sign in
See if blocking on registration still times out on travis...
commit660d554f6acd2dba8b605c84e8fa69e45708bc14 authorTim Watson <watson.timothy@gmail.com> dateTue 27 Nov 2018, 21:33 (8 years ago) parentc04f637
2 files changed+12−11
unifiedsplit
distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs+12−8 untilfail−3
distributed-process-tests/src/Control/Distributed/Process/Tests/CH.hs+12−8
@@ -1556,22 +1556,24 @@ testRegistryMonitoring :: TestTransport -> Assertion
15561556testRegistryMonitoring 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
untilfaildeleted−3
@@ -1,3 +0,0 @@
1−#!/bin/bash
2−
3−while $@; do :; done