Give macOS CI extra headroom for cancel-cascade tests

The `cpu_scaling_factor()` CI bump (2x) wasn't enough for the
macOS runners — slower + noisier than linux for our multi-actor
cancel-cascade timing — so `test_nested_multierrors[depth=3]` and
`test_fast_graceful_cancel_*` flaked there (linux + sdist green),

- make the CI headroom platform-aware: 3x on macOS, 2x on linux
  (keeps the proven linux budget; depth=3 inner 12*3=36s still
  fits under the 40s outer wall).
- give `test_fast_graceful_cancel_*` the `cpu_scaling_factor()`
  headroom it was missing entirely (was a bare `timeout=2.9`).

Verified locally w/ `CI=1` (2x linux path; 3x macOS path confirmed
via forced `_non_linux`).

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
trionics_start_or_cancel
Gud Boi 2026-06-18 14:54:07 -04:00
parent c797bcb783
commit 084f0fc404
2 changed files with 11 additions and 1 deletions

View File

@ -124,8 +124,12 @@ def cpu_scaling_factor() -> float:
# headroom. Apply a flat CI bump so every timing-test deadline
# /assert that keys off this factor gets headroom on CI HW
# (compounds with any local-throttle factor).
#
# macOS runners are noticeably slower + noisier than the linux
# ones for our multi-actor cancel-cascade tests, so give them
# extra headroom (3x vs 2x).
if _ci_env:
factor *= 2
factor *= 3 if _non_linux else 2
return factor

View File

@ -955,6 +955,12 @@ def test_fast_graceful_cancel_when_spawn_task_in_soft_proc_wait_for_daemon(
if _friggin_windows: # smh
timeout += 1
# CPU-scaling / CI latency headroom — macOS CI especially is
# slow for this graceful-vs-hard-reap timing race; see
# `cpu_scaling_factor()`.
from .conftest import cpu_scaling_factor
timeout *= cpu_scaling_factor()
async def main():
start = time.time()
try: