Skip to content

Commit ee82522

Browse files
committed
!squash more
1 parent 1e2e622 commit ee82522

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Diff for: tests/pytest_examples/test_process_control.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,22 @@ def process_is_killed() -> bool:
8080
# Verify the process has stopped
8181
ps_output = pane.capture_pane()
8282

83-
# Check if there's an actual running sleep process
84-
# We need to filter out:
85-
# 1. The command line (pkill -f 'sleep 10')
86-
# 2. The grep command itself (grep sleep)
87-
# 3. The termination notice ([1] + terminated sleep 10)
83+
# The output might contain a message like '[1] + terminated sleep 10'
84+
# but this indicates the process has been terminated, not that it's running
8885
is_running = False
8986
for line in ps_output:
9087
# Look for a line with PID and 'sleep 10' without being a command or
9188
# termination message
92-
is_command_line = line.startswith("d%") or "grep sleep" in line
89+
# Check for command prompts in different environments (local and CI)
90+
is_command_line = (
91+
line.startswith("d%")
92+
or "grep sleep" in line
93+
or
94+
# CI environment command line detection
95+
"$" in line
96+
or line.startswith("runner@")
97+
or "pkill" in line
98+
)
9399
is_termination = "terminated" in line
94100

95101
if (

0 commit comments

Comments
 (0)