Repository navigation
test: stop CI flakes from load tests and wall-clock checks - #22
Merged
Merged
Conversation
A local git merge writes "Merge branch ..." and the hook blocked it. CI skips merge commits (git log --no-merges), so the hook does too: it exits early while MERGE_HEAD exists.
"decodes in under 50 ms" failed on a slow CI runner (61 ms) while the code was right. The test now puts invalid base64 after the first 64 KB: an image read whole would not decode, one read by its header does. Checked: with the whole string decoded, the test fails.
A CI run on Node failed with three unit tests past vitest's 5 s timeout; they take 16-68 ms. That run was twice as slow as usual, and query/performance.test.ts, which takes 24 s, ran beside them. The load tests take most of the CPU, so on a slow runner the unit tests beside them stall, and their own timings get noise (latency.test.ts once measured a p95 of 661 ms). Two vitest projects now: unit (files in parallel) and perf (the three load test files, fileParallelism off), run one after the other by pnpm test. bun test already runs files one at a time, and its job never timed out. A longer timeout was rejected: it would hide a real hang too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Of 62 CI runs, the test failures that were not caused by code came from wall-clock limits on shared runners. The worst case: the load tests ran beside the unit tests.
query/performance.test.ts(24 s of CPU) ran beside them; run 2× slower than usualperfproject afterunitimageSize"under 50 ms" took 61 mslatencyp95 661 ms (fixed before in 596600a)Also: the
commit-msghook let no local merge commit through (Merge branch …); it now skips merges, as CI does.Evidence
query/performance49 s vs 24 s;serve14.8 s vs 1.0 s.vitest run→ 3 ×TestTimeoutError: Test timed out in 5000ms(run 44913102985).After:
pnpm testlocally → unit 84 files / 1069 tests in 5.0 s, then perf 3 files / 6 tests in 20.4 s.decodeBase64reads the whole string (checked by hand), passes on the real code.git merge --no-ffpasses;git commit -m "Bad subject"is blocked.pnpm checkgreen.Merge Danger
Door: two-way
Blast Radius: tests
CI's Node job runs the tests about 20 s longer: the load tests no longer overlap the rest.