diff --git a/tests/test_docs_examples.py b/tests/test_docs_examples.py index 4f791727..cce85292 100644 --- a/tests/test_docs_examples.py +++ b/tests/test_docs_examples.py @@ -160,7 +160,7 @@ def test_example( 'root-causing. Passes on Linux.' ) - from .conftest import cpu_scaling_factor + from .conftest import cpu_perf_headroom timeout: float = ( 60 @@ -168,8 +168,9 @@ def test_example( else 16 ) - # add latency headroom for CPU freq scaling (auto-cpufreq et al.) - headroom: float = cpu_scaling_factor() + # add latency headroom for CPU freq scaling/throttle + # (auto-cpufreq et al.) + headroom: float = cpu_perf_headroom() if headroom != 1.: timeout *= headroom diff --git a/tests/test_inter_peer_cancellation.py b/tests/test_inter_peer_cancellation.py index 6bf74880..e0bf5dab 100644 --- a/tests/test_inter_peer_cancellation.py +++ b/tests/test_inter_peer_cancellation.py @@ -24,7 +24,7 @@ from tractor._testing import ( expect_ctxc, ) -from .conftest import cpu_scaling_factor +from .conftest import cpu_perf_headroom pytestmark = [ pytest.mark.skipon_spawn_backend( @@ -1280,12 +1280,12 @@ def test_peer_spawns_and_cancels_service_subactor( async def _main(): - headroom: float = cpu_scaling_factor() + headroom: float = cpu_perf_headroom() this_fast_on_linux: float = 3 this_fast = this_fast_on_linux * headroom if headroom != 1.: test_log.warning( - f'Adding latency headroom on linux bc CPU scaling,\n' + f'Adding latency headroom on linux bc CPU perf scaling/throttle,\n' f'headroom: {headroom}\n' f'this_fast_on_linux: {this_fast_on_linux} -> {this_fast}\n' ) diff --git a/tests/test_resource_cache.py b/tests/test_resource_cache.py index 4902fb7a..049c0a6b 100644 --- a/tests/test_resource_cache.py +++ b/tests/test_resource_cache.py @@ -213,12 +213,12 @@ def test_open_local_sub_to_stream( N local tasks using `trionics.maybe_open_context()`. ''' - from .conftest import cpu_scaling_factor + from .conftest import cpu_perf_headroom timeout: float = ( 4 if not platform.system() == "Windows" else 10 - ) * cpu_scaling_factor() + ) * cpu_perf_headroom() if debug_mode: timeout = 999 diff --git a/tests/test_spawning.py b/tests/test_spawning.py index b6128b96..6237282e 100644 --- a/tests/test_spawning.py +++ b/tests/test_spawning.py @@ -153,9 +153,9 @@ async def test_most_beautiful_word( # actor spawn + IPC round-trip is comfortably sub-second on a # warm box, but slow/noisy CI runners (esp. macOS) blow a flat # 1s deadline. Scale for CI/CPU-throttle headroom — `== 1s` - # locally where `cpu_scaling_factor()` is `1.0`. - from .conftest import cpu_scaling_factor - with trio.fail_after(1 * cpu_scaling_factor()): + # locally where `cpu_perf_headroom()` is `1.0`. + from .conftest import cpu_perf_headroom + with trio.fail_after(1 * cpu_perf_headroom()): async with tractor.open_nursery( debug_mode=debug_mode, ) as an: