test/toggle.test.sh's --clear-limit assertion fails deterministically in some environments
Id: TD-PPagop-26080701 · Status: resolved · Filed: 2026-08-07 · Resolved: 2026-08-10 · Ref: https://github.com/Poetic-Poems/agent-ops/pull/280
test/toggle.test.sh fails one assertion, reproducibly, when run as
./test/toggle.test.sh (not under CI’s docker image) in at least one
environment observed so far:
FAIL - --clear-limit reports what it lifted expected to contain: stand-down lifted actual: agent-cycle: fleet usage-limit flag clearagent-cycle: no usage-limit stand-down was in forceIt is the only failure; every other assertion in the file (89 others at the
time this was filed) passes, including the fleet-flag and limit-flag
assertions immediately before it in the same “offline e2e” section
(test/toggle.test.sh:453-472).
This is not caused by real wall-clock time outrunning the test’s fixture
dates — the resume_at values the test publishes (2030-01-01T00:00:00Z,
2030-06-01T00:00:00Z, test/toggle.test.sh:454,468) are safely in the
future of any plausible run date, and TOGGLE_NOW_EPOCH is exported once at
the top of the file and inherited by every run_node subprocess, so the
pinned test clock (2026-07-17T12:00:00Z) should govern throughout. What
actually makes current_limit_record (agent-cycle.sh) — via
limit_union_record/limit_later_record in lib/limit-detect.sh — decide
no stand-down is in force at that point has not been root-caused.
Reproduces identically on an unmodified main
(bbf4312b3ed1490dcb6f668e54d11ce81d88ceec) and on top of #216 (the
--until/--help change), which only touches lib/toggle.sh,
agent-cycle.sh’s flag parsing/disable dispatch, review-cycle.sh’s flag
list, and docs — none of which this assertion’s code path runs through.
Filed rather than fixed there to keep that PR scoped to its own item.
Not reproduced against .github/workflows/build-image.yml’s own run (inside
the built docker image), so this may be specific to running the test file
directly against a working-tree checkout rather than the packaged image —
worth checking first.
Fix: run test/toggle.test.sh a few times directly (outside the docker
image) to confirm it’s reproducible there too and not a one-off from this
filing’s own environment, then trace current_limit_record’s reads for the
b_home node right after the second run_node "$b_home" agent-cycle.sh --clear-limit … call at test/toggle.test.sh:474 — likely candidates are
fleet_logs/fleet_peers_dir (agent-cycle.sh) picking up (or failing to
pick up) the right log file, or a filter in limit_union_record/
limit_later_record that behaves differently than the assertions
immediately before it expect.
Filed 2026-08-07, while implementing #213 (--until/--help, PR #216),
after confirming the failure predates that change.