mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-06 19:01:54 +00:00
The wall-clock budgets in this suite asserted a property the test cannot control. `make test` dispatches four suites concurrently through scripts/make/parallel.sh, each running `pytest -n auto`, so on a 12-core box up to 48 workers contend for 12 cores and a 14s single-threaded render stretches to anywhere between 65s and 141s. Five consecutive local gate runs failed here on four different assertions while CI, whose integration suite was green throughout, saw nothing. Measurement, not guesswork: the render costs ~14s of CPU and wall matches CPU almost exactly when the suite runs alone, so CPU seconds are the contention- invariant quantity. An A/B against the 2026-07-30 tree renders 12% slower than HEAD, which rules out a regression as the cause of the breaches. The assertions therefore measure `time.process_time()`, and both cold-render ceilings collapse into one 30s CPU budget. That is stricter than the 60s and 100s wall-clock ceilings it replaces, since CPU time never exceeds wall time. The cold-to-hot ratio assertion is untouched: numerator and denominator are sampled in the same process under the same load, so it was already immune. The suite moves to tests/performance/, which takes it out of the `test` fan-out because run.sh derives the suite directory from the test type, and gains a `test-performance` target plus the alias the lint requires. What remains in the commit gate is deterministic. Two redundant cold renders are gone with it: the applications and domains budgets each had a second test that re-rendered the same state purely to assert a ceiling the first test had already measured. All eight assertions survive as subTests, with each cold-render check placed immediately after its measurement so an exception in the hot loop cannot swallow its verdict. The file drops from 88s to 49s.
4 lines
83 B
Python
4 lines
83 B
Python
from pathlib import Path
|
|
|
|
PROJECT_ROOT: Path = Path(__file__).resolve().parents[2]
|