From 9f36e743a9982de84bbaeed0cf6148f1d67e5610 Mon Sep 17 00:00:00 2001 From: goodboy Date: Tue, 30 Jun 2026 02:45:23 -0400 Subject: [PATCH] Scale `test_lifetime_stack` deadline for CI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `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 --- tests/test_runtime.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_runtime.py b/tests/test_runtime.py index 782af81e..8a73d6aa 100644 --- a/tests/test_runtime.py +++ b/tests/test_runtime.py @@ -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(