Skip to content

Commit

Permalink
!squash more
Browse files Browse the repository at this point in the history
  • Loading branch information
tony committed Feb 26, 2025
1 parent 1e2e622 commit ee82522
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions tests/pytest_examples/test_process_control.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down

0 comments on commit ee82522

Please sign in to comment.