From ee825229e0e3a1f08ac1919c67ff3f430aa157be Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Wed, 26 Feb 2025 06:36:16 -0600 Subject: [PATCH] !squash more --- tests/pytest_examples/test_process_control.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/tests/pytest_examples/test_process_control.py b/tests/pytest_examples/test_process_control.py index 23b278925..2061c50e8 100644 --- a/tests/pytest_examples/test_process_control.py +++ b/tests/pytest_examples/test_process_control.py @@ -80,16 +80,22 @@ def process_is_killed() -> bool: # Verify the process has stopped ps_output = pane.capture_pane() - # Check if there's an actual running sleep process - # We need to filter out: - # 1. The command line (pkill -f 'sleep 10') - # 2. The grep command itself (grep sleep) - # 3. The termination notice ([1] + terminated sleep 10) + # The output might contain a message like '[1] + terminated sleep 10' + # but this indicates the process has been terminated, not that it's running is_running = False for line in ps_output: # Look for a line with PID and 'sleep 10' without being a command or # termination message - is_command_line = line.startswith("d%") or "grep sleep" in line + # Check for command prompts in different environments (local and CI) + is_command_line = ( + line.startswith("d%") + or "grep sleep" in line + or + # CI environment command line detection + "$" in line + or line.startswith("runner@") + or "pkill" in line + ) is_termination = "terminated" in line if (