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")