Skip to content

Commit 78ae633

Browse files
committed
Pin the grace probe in the tick-driven teardown tests
Both tests need the grace loop to reach their injected tick; on a fast runner the group can read as spent on the first probe and the loop breaks before the tick fires. The tests' subject is the tick's effect, not liveness, so the probe is pinned open.
1 parent acc4cba commit 78ae633

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

tests/test_terminal_process.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1194,6 +1194,9 @@ def interrupting_tick():
11941194
raise KeyboardInterrupt()
11951195

11961196
process._grace_tick = interrupting_tick
1197+
# The subject is exception propagation, not liveness: pin the probe so the
1198+
# grace loop cannot break before the tick fires on a fast tree.
1199+
process._group_spent = lambda pgid: False
11971200
with pytest.raises(KeyboardInterrupt):
11981201
process.terminate_tree(grace=1.0)
11991202
finally:
@@ -1223,6 +1226,7 @@ def failing_tick():
12231226
real_tick()
12241227

12251228
process._grace_tick = failing_tick
1229+
process._group_spent = lambda pgid: False # the fault must get its tick
12261230
process.terminate_tree(grace=0.5)
12271231
finally:
12281232
process.close()

0 commit comments

Comments
 (0)