diff --git a/tests/test_advanced_streaming.py b/tests/test_advanced_streaming.py index c04bf130..826634af 100644 --- a/tests/test_advanced_streaming.py +++ b/tests/test_advanced_streaming.py @@ -189,11 +189,16 @@ def test_dynamic_pub_sub( # sits forever until external SIGINT. The `afk_alarm_w_trace` # outer guard below is the AFK-safety counterpart (SIGALRM # raises in the main thread regardless of trio scope state). - fail_after_s: int = ( + # scale the budget for slow/noisy CI runners (esp. macOS, where + # `cpu_scaling_factor()` applies a 3x CI bump) so a sluggish + # runner doesn't trip the deadline and inject a `TooSlowError` + # that collides with the `expect_cancel_exc=TooSlowError` param. + from .conftest import cpu_scaling_factor + fail_after_s: float = ( 8 if is_forking_spawner else 20 - ) + ) * cpu_scaling_factor() async def main(): # bug-class-3 breadcrumb: tag each level of the cancel path diff --git a/tests/test_ringbuf.py b/tests/test_ringbuf.py index e55a87b9..2c739568 100644 --- a/tests/test_ringbuf.py +++ b/tests/test_ringbuf.py @@ -1,10 +1,22 @@ import time +import platform import trio import pytest import tractor +# `tractor.ipc._ringbuf` is built on linux `eventfd(2)`; importing +# it pulls in `tractor.ipc._linux` whose module-level +# `ffi.dlopen(None)` raises on non-linux. Skip the whole module at +# COLLECTION before that crashing import runs (a `pytestmark` skip +# is too late — markers apply only after the import succeeds). +if platform.system() != 'Linux': + pytest.skip( + 'ringbuf (eventfd) IPC is linux-only', + allow_module_level=True, + ) + # XXX `cffi` dun build on py3.14 yet.. pytest.importorskip("cffi")