diff --git a/tests/conftest.py b/tests/conftest.py index 28a7ef64..5d5ce803 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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 diff --git a/tests/test_cancellation.py b/tests/test_cancellation.py index 371d70ad..5566691a 100644 --- a/tests/test_cancellation.py +++ b/tests/test_cancellation.py @@ -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: