Skip to content

Commit f62674c

Browse files
committed
mtest: Wait for 60 seconds after SIGTERM for test process to exit
When using meson to run integration tests and an integration test times out, we still want the opportunity to analyze and save the logs from the integration test so we can figure out why the test got stuck. Currently, meson only gives test processes half a second to handle SIGTERM before it sends SIGKILL, which is not sufficient time to analyze all the logs and do all other cleanup. Let's bump the timeout after sending SIGTERM to 60s, so that test processes that wish to do cleanup get some time to do so. This only has an effect if the test process installs a custom SIGTERM handler. If the test process doesn't do so, it'll get exited immediately like before.
1 parent a717554 commit f62674c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonbuild/mtest.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ async def _kill(self) -> T.Optional[str]:
13941394
# Make sure the termination signal actually kills the process
13951395
# group, otherwise retry with a SIGKILL.
13961396
with suppress(asyncio.TimeoutError):
1397-
await asyncio.wait_for(p.wait(), timeout=0.5)
1397+
await asyncio.wait_for(p.wait(), timeout=60)
13981398
if p.returncode is not None:
13991399
return None
14001400

0 commit comments

Comments
 (0)