mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-08 11:46:35 +00:00
fix(ci): widen the headroom test's timing margin
67b6072bb tightened this test's assertion from "Skipping distro|budget
exhausted" to the headroom line alone, and in the same change shrank the
command and budget from sleep 3 / 5s to sleep 2 / 3s. That left the branch
reachable only when the first iteration measures exactly 2s.
distros.sh times with `date +%s`, whole seconds, so a measured duration
carries up to a second of boundary rounding on top of bash startup and two
`source scripts/meta/env/load.sh`. Run 31823654078 booked `sleep 2` as 3s,
took the `remaining <= 0` branch instead, and never printed the line the
test greps for:
>>> Duration: distro=debian took 3s (max_seen=3s)
[WARN] Global budget exhausted (remaining=0s). Stopping further distro runs.
It is a race and not a defect in the script: on the same commit manjaro and
centos both passed base/06_test.sh and moved on to 07_console.sh, and only
ubuntu lost it, twice within the one job.
Reaching the branch needs d < B < 2.15*d for a measured first duration d.
At 2 / 3s the window admitted d=2 alone. At 4 / 7s it admits 4, 5 and 6 -
three seconds of slack against the one second CI actually overshot by. The
assertion is unchanged, so the branch is still genuinely exercised rather
than relaxed, and the suite pays two more seconds.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
437572037a
commit
040955ebf2
1 file changed
+2
-2
@@ -112,8 +112,8 @@ class TestDistrosLoop(unittest.TestCase):
|
||||
def test_a_distro_needs_the_slowest_run_plus_headroom_to_start(self) -> None:
|
||||
proc, record = self._run(
|
||||
DISTROS,
|
||||
'sleep 2\necho "${INFINITO_DISTRO}" >> "${RECORD}"',
|
||||
INFINITO_CI_DISTRO_BUDGET_SECONDS="3",
|
||||
'sleep 4\necho "${INFINITO_DISTRO}" >> "${RECORD}"',
|
||||
INFINITO_CI_DISTRO_BUDGET_SECONDS="7",
|
||||
)
|
||||
self.assertEqual(proc.returncode, 0, proc.stderr)
|
||||
self.assertEqual(len(record.split()), 1)
|
||||
|
||||
Reference in new issue
Block a user