Scale `test_lifetime_stack` deadline for CI

`test_lifetime_stack_wipes_tmpfile` guards spawn+teardown with a
hard-coded `trio.move_on_after()` (1.6s / 1s) that isn't scaled
for slow CI. On a noisy macOS runner the `error_in_child=True`
case times out before the child error propagates, so the scope
cancels and `assert not cs.cancel_called` flips — reddening the
(required) macOS leg. Same unscaled-deadline class `main` already
fixed for `test_dynamic_pub_sub`.

- multiply the budget by `cpu_perf_headroom()` (`tests/conftest`),
  the established deadline-headroom helper (3x on macOS CI, a
  1.0 no-op locally / on un-throttled linux).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
windows_support_round2
Gud Boi 2026-06-30 02:45:23 -04:00
parent 08f7a3a9b8
commit 9f36e743a9
1 changed files with 5 additions and 0 deletions

View File

@ -73,6 +73,11 @@ async def test_lifetime_stack_wipes_tmpfile(
1.6 if error_in_child
else 1
)
# scale for slow/noisy CI (esp. macOS) so the child error
# propagates before the deadline; otherwise `move_on_after`
# cancels first and flips the `error_in_child=True` assert.
from .conftest import cpu_perf_headroom
timeout *= cpu_perf_headroom()
try:
with trio.move_on_after(timeout) as cs:
async with tractor.open_nursery(