From 556a5ee24e21f488f860fabcf67a180d780780c3 Mon Sep 17 00:00:00 2001 From: "duanjialing.777" Date: Fri, 2 Oct 2026 12:30:09 +0800 Subject: [PATCH] test(runtime): wait for natural exit before cleanup Signed-off-by: duanjialing.777 --- tests/control_plane/test_effect_runtime_integration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/control_plane/test_effect_runtime_integration.py b/tests/control_plane/test_effect_runtime_integration.py index abcf49e3b5..5fb13f2c05 100644 --- a/tests/control_plane/test_effect_runtime_integration.py +++ b/tests/control_plane/test_effect_runtime_integration.py @@ -982,6 +982,12 @@ def write() -> dict[str, object]: assert json.loads(journal_path.read_text(encoding="utf-8")) == journal finally: lock_path.unlink(missing_ok=True) + cleanup_deadline = time.monotonic() + 3 + while time.monotonic() < cleanup_deadline: + effect_runtime._reap_exited_runtime_child(info) + if not effect_runtime._pid_is_alive(original["pid"]): + break + time.sleep(0.025) if effect_runtime._pid_is_alive(original["pid"]): os.kill(int(original["pid"]), signal.SIGTERM)