From 2530939c0fb55ed27ea44e21cec5ee8fd2db7beb Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Wed, 13 Aug 2025 01:12:10 -0700 Subject: [PATCH] fix: prevent wrapper from detecting itself as remaining process MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add PID and script name checks in post-test verification - Avoid false positive detection of wrapper process as 'remaining' - This prevents unnecessary cleanup calls that could cause hangs - Root cause: wrapper was trying to clean up itself in verification phase 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- scripts/ci_pytest_wrapper.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/scripts/ci_pytest_wrapper.py b/scripts/ci_pytest_wrapper.py index 10645bb..53514f5 100755 --- a/scripts/ci_pytest_wrapper.py +++ b/scripts/ci_pytest_wrapper.py @@ -149,11 +149,19 @@ def run_pytest_with_monitoring(pytest_args): try: result = subprocess.run(["ps", "aux"], capture_output=True, text=True, timeout=5) - remaining = [ - line - for line in result.stdout.split("\n") - if "python" in line and ("pytest" in line or "embedding" in line) - ] + lines = result.stdout.split("\n") + current_pid = str(os.getpid()) + + remaining = [] + for line in lines: + # Skip our own wrapper process + if current_pid in line or "ci_pytest_wrapper.py" in line: + continue + # Only check for actual problematic processes + if "python" in line and ("pytest" in line or "embedding" in line): + # Skip debug script too + if "ci_debug_pytest.py" not in line: + remaining.append(line) if remaining: print(f"⚠️ [WRAPPER] Found {len(remaining)} remaining processes:")