Skip to content

fix: tolerate a 1s timing tie in test-run-all-timing.sh (#482) - #486

Merged
fdaviddpt merged 2 commits into
mainfrom
fix/482-run-all-timing-tie
Oct 6, 2026
Merged

fdaviddpt merged 2 commits into
mainfrom
fix/482-run-all-timing-tie

Conversation

@fdaviddpt

Copy link
Copy Markdown
Contributor

Closes #482
On a loaded Windows runner, tests/test-run-all-timing.sh's ordering assertion could fail on a genuine whole-second-resolution tie between the fast and slow fixtures: run-all.sh's timing block sorts on a single key (sort -t ... -k1,1rn, no secondary key), so a tie falls back to name order and test-a-fast.sh sorts before test-b-slow.sh even though it is not actually slower.
Two changes, both suggested in the issue:

  1. test-b-slow.sh now sleeps 2s instead of 1s, so a tie needs the fast fixture to straddle two second boundaries instead of one.
  2. The ordering assertion now compares the two suites' own printed times. When they differ, it still asserts strict slow-before-fast line-position ordering (the positive control against a real sort regression). When they tie, it reports the result as inconclusive (SKIP) rather than a hard failure, and a closing tally line now surfaces that count explicitly ($PASS/$TOTAL passed, $FAIL failed, $SKIP skipped (inconclusive, not counted above)).
    A guard was added so a tie can never mask a broken timer: test-b-slow.sh sleeps a full 2 seconds, so a correct measurement can never read below 2 for it. If the slow suite's own printed time is below 2s, that is a hard FAIL (not a tie, a broken timer), not a SKIP -- this closes a self-review finding where a stuck-at-1s stub for every suite would otherwise have been silently absorbed into SKIPPED.
    Verified: reproduced the exact pre-fix failure mode with a synthetic tied-at-1s fixture (matches the issue's own reported slow_line=10 fast_line=9 shape); confirmed the new logic reports SKIP instead on the same fixture; confirmed a synthetic genuine-regression fixture (distinct times, reversed order) still fails. bash tests/test-run-all-timing.sh: 13/13 passed. Adjacent bash tests/test-run-all-shard.sh: 16/16 passed, no regression. python3 .oss/assemble_changelog.py --check: exit 0.
    Self-review (two independent spawns) found two issues with the first draft, both fixed in a follow-up commit: the tie-tolerant SKIP branch could not distinguish a genuine tie from a broken timer (fixed via the SLOW_SECS >= 2 guard above), and the closing tally line silently excluded SKIPPED checks from its denominator (fixed via the new SKIP counter and tally line).

[AI-generated]

Florian DAVID and others added 2 commits October 6, 2026 18:37
test-b-slow.sh now sleeps 2s instead of 1s, widening the margin against a
loaded CI runner crossing a second boundary on the near-instant fixture. The
ordering assertion also compares the two suites' printed times: when they
differ, the strict slow-before-fast line-position check still applies (the
positive control against a real sort regression); when they tie at 1s
resolution, the order is genuinely undefined, so the check reports it as an
inconclusive skip rather than a flaky failure.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
Review (Explore) found the tie-detection added for #482 was too permissive:
comparing only the two suites' parsed printed times meant a stub that always
printed the same constant (e.g. "1s" for every suite, a broken $SECONDS
measurement) would be read as a legitimate tie and silently SKIPPED rather
than failed. test-b-slow.sh sleeps a full 2 seconds, so a correct measurement
can never read below 2 for it -- that is now asserted unconditionally, before
the tie check runs, so a stuck/stubbed timer fails hard instead of sliding
into the tie-tolerant branch.

The same review also noted the closing tally line (PASS/TOTAL passed, FAIL
failed) silently excluded a tie from its denominator with no indication
anything was skipped. Added a SKIP counter and a skip() helper alongside
ok()/bad(), and the closing line now names the skip count when one occurred.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
@fdaviddpt
fdaviddpt merged commit 47417bf into main Oct 6, 2026
13 checks passed
@fdaviddpt
fdaviddpt deleted the fix/482-run-all-timing-tie branch October 6, 2026 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test-run-all-timing.sh flakes on Windows: a 1s tie between the fast and slow fixtures sorts by name

1 participant