energy tests: hold under a host loaded past a hundred runnable threads #166
Loading…
Reference in a new issue
No description provided.
Delete branch "energy/load-robust-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Two existing tests failed on the dev Mac, which is also the macOS CI runner, at load averages of 101–179. Neither failure was in the meters.
eoc-meter
the_probe_burns_its_tick_of_thread_cpu_between_samplesProbeRunkept no tick's wall time, so the test couldn't tell a starved tick from a skipped one.ProbeRunrecordstick_walls, each tick's wall time. It is recorded for the tests and decides nothing.jouleclaw-energy
process_cpu/bin/shchild, run for a fixed 300 ms, got 0.076 J of CPU against a 0.2 J sanity floor at load average 170. It failed 3 of 3 runs.Verified at load averages of 105–333:
cargo test -p eoc-meter: 80 tests pass.cargo test -p jouleclaw-energy --features ioreport: 121 tests pass.🤖 Generated with Claude Code
Two tests failed on the dev Mac, which is also the macOS CI runner, at load averages of 101-179. Neither failure was in the meters: - eoc-meter `the_probe_burns_its_tick_of_thread_cpu_between_samples`. A tick burned only 9.6 ms of the thread's CPU, under the 12.5 ms floor, because its 500 ms wall cap cut it short. The test's own message names that cap as the one thing allowed to shorten a tick, but the test could not tell it apart: ProbeRun recorded no tick's wall time. It now records each tick's wall time (`tick_walls`; recorded, never decided on). A tick that ran its whole wall cap is accepted as cut short, but only if it still spun, burning at least 1 ms of CPU. Any other tick must burn at least half its 25 ms, as before. - jouleclaw-energy `process_cpu`. The `/bin/sh` child, run for a fixed 300 ms, got 0.076 J of CPU against a 0.2 J sanity floor (load average 170). It failed 3 of 3 runs. The child now runs until its own counter reads 0.2 J (at least 300 ms, at most 5 s), as eoc-meter's equivalent test already does. The parent's window still spans the child's whole run. Both pass at a load average of 333. Both tick mutations are caught: a tick that sleeps through its wall cap ("ran its whole 504.6ms wall cap and burned only 87.375µs ... it waited, not spun"), and one that sleeps 25 ms. Co-Authored-By: Claude Opus 5.5 <[email protected]>