@@ -483,6 +483,20 @@ testMergeChannels transport = do
483483 liftIO $ threadDelay 10000 -- Make sure messages have been sent
484484 return rport
485485
486+testTerminate :: NT.Transport -> IO ()
487+testTerminate transport = do
488+ localNode <- newLocalNode transport initRemoteTable
489+
490+ pid <- forkProcess localNode $ do
491+ liftIO $ threadDelay 100000
492+ terminate
493+
494+ runProcess localNode $ do
495+ ref <- monitor pid
496+ MonitorNotification ref' pid' (DiedException ex) <- expect
497+ True <- return $ ref == ref' && pid == pid' && ex == "ProcessTerminationException"
498+ return ()
499+
486500main :: IO ()
487501main = do
488502 Right transport <- createTransport "127.0.0.1" "8080" defaultTCPParameters
@@ -494,6 +508,7 @@ main = do
494508 , ("SendToTerminated", testSendToTerminated transport)
495509 , ("TypedChannnels", testTypedChannels transport)
496510 , ("MergeChannels", testMergeChannels transport)
511+ , ("TestTerminate", testTerminate transport)
497512 -- The "missing" combinations in the list below don't make much sense, as
498513 -- we cannot guarantee that the monitor reply or link exception will not
499514 -- happen before the unmonitor or unlink