@@ -17,7 +17,7 @@ import Control.Concurrent.MVar
17
17
, takeMVar
18
18
, readMVar
19
19
)
20
- import Control.Monad (replicateM_ , replicateM , forever , void , unless )
20
+ import Control.Monad (replicateM_ , replicateM , forever , void , unless , join )
21
21
import Control.Exception (SomeException , throwIO )
22
22
import qualified Control.Exception as Ex (catch )
23
23
import Control.Applicative ((<$>) , (<*>) , pure , (<|>) )
@@ -719,6 +719,21 @@ testSpawnLocal TestTransport{..} = do
719
719
720
720
takeMVar done
721
721
722
+ testSpawnAsyncStrictness :: TestTransport -> Assertion
723
+ testSpawnAsyncStrictness TestTransport {.. } = do
724
+ node <- newLocalNode testTransport initRemoteTable
725
+ done <- newEmptyMVar
726
+
727
+ runProcess node $ do
728
+ here <- getSelfNode
729
+
730
+ ev <- try $ spawnAsync here (error " boom" )
731
+ liftIO $ case ev of
732
+ Right _ -> putMVar done (error " Exception didn't fire" )
733
+ Left (_:: SomeException ) -> putMVar done (return () )
734
+
735
+ join $ takeMVar done
736
+
722
737
testReconnect :: TestTransport -> Assertion
723
738
testReconnect TestTransport {.. } = do
724
739
[node1, node2] <- replicateM 2 $ newLocalNode testTransport initRemoteTable
@@ -1370,6 +1385,7 @@ tests testtrans = return [
1370
1385
, testCase " Registry" (testRegistry testtrans)
1371
1386
, testCase " RemoteRegistry" (testRemoteRegistry testtrans)
1372
1387
, testCase " SpawnLocal" (testSpawnLocal testtrans)
1388
+ , testCase " SpawnAsyncStrictness" (testSpawnAsyncStrictness testtrans)
1373
1389
, testCase " HandleMessageIf" (testHandleMessageIf testtrans)
1374
1390
, testCase " MatchAny" (testMatchAny testtrans)
1375
1391
, testCase " MatchAnyHandle" (testMatchAnyHandle testtrans)
0 commit comments