From 2d87cffa20b6d9c305aaba334e3d26688a002a2b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Strub Date: Sat, 25 May 2024 18:10:08 +0200 Subject: [PATCH] runtest: when EC is killed, display an error message --- scripts/testing/runtest | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/scripts/testing/runtest b/scripts/testing/runtest index 890f422a3f..8c1048fb05 100755 --- a/scripts/testing/runtest +++ b/scripts/testing/runtest @@ -531,8 +531,6 @@ MARKS = { ('✓', CurseWrapper.COLOR_GREEN), -signal.SIGINT: ('ϟ', CurseWrapper.COLOR_YELLOW), - -signal.SIGTERM: - ('ϟ', CurseWrapper.COLOR_YELLOW), None: ('✗', CurseWrapper.COLOR_RED), } @@ -705,7 +703,20 @@ async def _run_all(options, allscripts, listener : Listener): status = await asyncio.wait_for(proc.wait(), 2.0) except asyncio.TimeoutError: - proc.kill(); status = await proc.wait() + listener.error( + handle, 'critical', + 'Timeout in wait() -- killing process' + ) + proc.kill() + status = await proc.wait() + + if status < 0: + procsig = -status + if procsig != signal.SIGINT: + listener.error( + handle, 'critical', + f'Killed (signal = {signal.Signals(procsig).name})' + ) success = (bool(status) != bool(config.isvalid))