git.iko.soy/distributed-process
on master help sign in
Extend test to show bug in pipes transport

The pipes transport does not distinguish between multiple connections per transport, and might match a send on one connection with a receive on another.

commit555b2c1595df119dca72502370c187b3ea0691ab authorEdsko de Vries <edsko@well-typed.com> dateTue 10 Apr 2012, 14:12 (15 years ago) parent6b26fa9
1 file changed+5−3
examples/DemoTransport.hs+5−3
examples/DemoTransport.hs+5−3
@@ -133,14 +133,16 @@ demo4 mktrans = do
133133 sourceEnd1 <- connect sourceAddr1
134134 sourceEnd2 <- connect sourceAddr2
135135
136− send sourceEnd1 [BS.pack "hello1"]
137− send sourceEnd2 [BS.pack "hello2"]
136+ threadId3 <- forkIO $ forM_ [1..10] $ \i -> send sourceEnd1 [BS.pack ("A" ++ show i)]
137+ threadId4 <- forkIO $ forM_ [1..10] $ \i -> send sourceEnd2 [BS.pack ("B" ++ show i)]
138138
139− threadDelay 100000
139+ threadDelay 1000000
140140
141141 putStrLn "demo4: Time, up, killing threads & closing transports.."
142142 killThread threadId1
143143 killThread threadId2
144+ killThread threadId3
145+ killThread threadId4
144146 putStrLn "demo4: Threads killed."
145147 closeTransport trans
146148 putStrLn "demo4: Done."