fix: prevent wrapper from detecting itself as remaining process
- 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 <noreply@anthropic.com>
This commit is contained in:
@@ -149,11 +149,19 @@ def run_pytest_with_monitoring(pytest_args):
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
result = subprocess.run(["ps", "aux"], capture_output=True, text=True, timeout=5)
|
result = subprocess.run(["ps", "aux"], capture_output=True, text=True, timeout=5)
|
||||||
remaining = [
|
lines = result.stdout.split("\n")
|
||||||
line
|
current_pid = str(os.getpid())
|
||||||
for line in result.stdout.split("\n")
|
|
||||||
if "python" in line and ("pytest" in line or "embedding" in line)
|
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:
|
if remaining:
|
||||||
print(f"⚠️ [WRAPPER] Found {len(remaining)} remaining processes:")
|
print(f"⚠️ [WRAPPER] Found {len(remaining)} remaining processes:")
|
||||||
|
|||||||
Reference in New Issue
Block a user