Skip to content

Commit c39c9e4

Browse files
committed
TESTING: Add some noise to debugging
1 parent 1628455 commit c39c9e4

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

integration/test/Testlib/ModService.hs

+6-4
Original file line numberDiff line numberDiff line change
@@ -405,15 +405,17 @@ data ServiceInstance = ServiceInstance
405405
timeout :: Int -> IO a -> IO (Maybe a)
406406
timeout usecs action = either (const Nothing) Just <$> race (threadDelay usecs) action
407407

408-
cleanupService :: (HasCallStack) => ServiceInstance -> IO ()
409-
cleanupService inst = do
408+
cleanupService :: (HasCallStack) => Service -> String -> ServiceInstance -> IO ()
409+
cleanupService svc domain inst = do
410410
mPid <- getPid inst.handle
411411
for_ mPid (signalProcess keyboardSignal)
412412
timeout 50000 (waitForProcess inst.handle) >>= \case
413-
Just _ -> pure ()
413+
Just _ ->
414+
putStrLn $ "[" <> show svc <> "@" <> domain <> "] is dead"
414415
Nothing -> do
415416
for_ mPid (signalProcess killProcess)
416417
void $ waitForProcess inst.handle
418+
putStrLn $ "[" <> show svc <> "@" <> domain <> "] was killed with -9"
417419
whenM (doesFileExist inst.config) $ removeFile inst.config
418420
whenM (doesDirectoryExist inst.config) $ removeDirectoryRecursive inst.config
419421

@@ -468,7 +470,7 @@ withProcess resource overrides service = do
468470

469471
void $ Codensity $ \k -> do
470472
iok <- appToIOKleisli k
471-
liftIO $ E.bracket initProcess cleanupService iok
473+
liftIO $ E.bracket initProcess (cleanupService service domain) iok
472474

473475
lift $ waitUntilServiceIsUp domain service
474476

0 commit comments

Comments
 (0)