From e508fb95412723d9f3e7eca30801e43fe0992bbd Mon Sep 17 00:00:00 2001 From: cesnimda Date: Mon, 31 Aug 2026 22:14:37 +0200 Subject: [PATCH] test(parser): treat reaped container zombies as terminated --- tools/summarizer/tests/test_app.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tools/summarizer/tests/test_app.py b/tools/summarizer/tests/test_app.py index 845707e..866d683 100644 --- a/tools/summarizer/tests/test_app.py +++ b/tools/summarizer/tests/test_app.py @@ -738,6 +738,17 @@ def test_parser_timeout_terminates_descendants(monkeypatch, tmp_path): except ProcessLookupError: pass else: + # Minimal CI containers may not run an init process that promptly + # reaps orphaned children. A zombie has already been terminated and + # cannot execute or retain parser resources, even though kill(pid, 0) + # continues to see its process-table entry. + stat_path = Path(f"/proc/{descendant_pid}/stat") + try: + state = stat_path.read_text(encoding="ascii").split()[2] + except (FileNotFoundError, IndexError, OSError): + state = None + if state == "Z": + return os.kill(descendant_pid, 9) raise AssertionError("Parser descendant survived the parent deadline")