tractor/tests/devx
Gud Boi 20cb99ecd4 Add `cpu_perf_headroom()` for throttle-aware deadlines
Mass `trio` deadline-miss failures on byte-identical code turned
out to be a firmware/EC power-cap (AMD PPT/STAPM) clamping the
all-core sustained clock while every static knob (`governor`,
`scaling_max_freq`, EPP, platform-profile) still read "performance"
— invisible to the existing `cpu_scaling_factor()` check. See
`scripts/cpu-perf-check` + the
`ai/conc-anal/trio_033_cancel_cascade_slowdown_depth3_issue.md`
notes.

Deats,
- add `_measure_sustained_headroom()` to `tests/conftest.py`: a
  one-shot ~0.9s all-core burn (explicit `fork`-ctx `mp` procs)
  sampling achieved-vs-max freq AFTER the boost window; under a 0.6
  gate it returns the full inverse fraction (capped 4x), else 1.0;
  best-effort 1.0 on non-linux or any error,
- add `cpu_perf_headroom()`: `max()` of the static scaling factor
  and the (session-cached) sustained probe,
- inflate deadline budgets by it in `test_dynamic_pub_sub`, both
  `test_clustering` cases, the
  `test_multi_nested_subactors_error_through_nurseries` pexpect
  waits + `test_nested_multierrors`,
- `xfail(strict=False)` `test_nested_multierrors` depth=3 under
  throttle: the deep tree trips tractor's INTERNAL reap deadlines
  (`soft_kill`/`hard_kill` `terminate_after=1.6`) minting a
  `Cancelled` inside the runtime — not fixable by test-budget
  inflation; auto-clears once the box un-throttles.

(this patch was generated in some part by [`claude-code`][claude-code-gh])
[claude-code-gh]: https://github.com/anthropics/claude-code
2026-06-12 13:37:05 -04:00
..
__init__.py Officially test proto-ed `stackscope` integration 2025-03-27 13:24:25 -04:00
conftest.py Strip ANSI + accept `_create(...)` in devx tests 2026-06-02 00:41:06 -04:00
test_debugger.py Add `cpu_perf_headroom()` for throttle-aware deadlines 2026-06-12 13:37:05 -04:00
test_pause_from_non_trio.py Update `sync_bp` + tighten `test_pause_from_sync` 2026-04-30 20:54:50 -04:00
test_proctitle.py TOSQUASH 3a45dbd5, sync proctitle tests+doc to `_def_prefix` 2026-06-02 00:51:52 -04:00
test_tooling.py Adjust `test_shield_pause` for capsys backends 2026-05-01 19:08:55 -04:00