Repository navigation
test: busy timeout for E2E sqlite3 CLI seeding - #607
Merged
Merged
Conversation
The sqlite3 CLI has no busy timeout by default, so an E2E suite that shells out to it while a real server/ingestor process holds a write lock on the same DB fails at once with "database is locked" instead of waiting (#606). Give every sqlite3 CLI call in the E2E suites a 5s busy timeout via '-cmd', '.timeout 5000', and add scripts/check-sqlite3-busy-timeout.js (wired into the js-test CI job) as a static regression check that every sqlite3 CLI invocation anywhere in the repo sets one. Relates to #606
Collaborator
Author
Rapport — CS-Macmini PR#607 #606 — head 2a69006Status: All requirements met, CI all green on first attempt, no flake encountered. Requirement coverage
Invariants
CI per job (run 40209689348)
[K] Known: the #271 flake mentioned in the task instructions did not occur on this run; all three E2E shards passed on the first attempt, so no rerun was needed. Local verification (before pushing)
Residuals
|
Collaborator
Review — CS-MacBook PR#607 — head 2a69006Dom: APPROVE med nits Read-only review. Head was unchanged before and after ( Findings
No blocking findings. Answers to the review points
Invariants
Tests (merged tree,
|
| Mutant | Self-test | Verdict |
|---|---|---|
TIMEOUT_RE never matches |
4 pass / 3 fail | caught |
Never flag (if (false)) |
3 pass / 4 fail | caught |
Call-head regex limited to execSync |
3 pass / 4 fail | caught |
| Span limited to the call-head line | 7 pass / 0 fail | survived (finding #1) |
Product: revert the one-line timeout in test-channel-proposals-e2e.js |
checker exits 1, :382 |
caught |
Not verified
- Whether the original flake is gone in practice. It is timing-dependent, so I only showed the mechanism, not a statistical effect. [A]
- Playwright E2E shards in CI beyond reading their job results. I did not re-run the full E2E suite, only the three affected suites. [K]
- Known flakes flaky: #226 Hash Stats adopters sort E2E — server sorts multiByteNodes on packets only, ties come out in random order #256 and flaky: TestResolvedPathBackfill_WriteHoldUnderBudget_188 — wall-clock write-hold budget fails under CI load #267 did not appear in the CI run. [K]
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.
Relates to #606
Problem
test-region-scope-approval-e2e.jsseeds rows with thesqlite3CLI(
execFileSync('sqlite3', [env.db, statement], ...)) while the realingestor/server processes it starts may hold a write lock on the same
DB file. The CLI has no busy timeout, so it fails at once with
database is lockedinstead of waiting — a flaky failure, not a realbug (CI run 40205480480, E2E shard 3).
Fix
sqlite3CLI call in the E2E suites a 5s busy timeoutvia
['-cmd', '.timeout 5000', ...]:test-region-scope-approval-e2e.js— thesql()helper usedthroughout the suite while the stack is live (the exact call from
the issue).
test-channel-proposals-e2e.js— one direct seeding call whilethe stack is live.
test-issue-315-estimated-positions-e2e.js— three calls(schema extraction + seed) that run before its server starts;
fixed for consistency and to keep the regression check simple
and uniform rather than carving out an exception.
scripts/check-sqlite3-busy-timeout.js, a static regressioncheck: walks every
.jsfile in the repo, findssqlite3CLIinvocations (
execFileSync/execSync/spawnSync/spawn), andfails if any call's argument list lacks a busy-timeout marker
(
-cmd/.timeout, or an embeddedPRAGMA busy_timeout). Matchingwalks balanced parens rather than scanning line-by-line, so it
still catches a call whose argument list spans multiple lines (the
shape the schema-extraction call uses).
scripts/test-check-sqlite3-busy-timeout.js,and wired both into the
js-testCI job right after the existingCSS-vars lint step.
Tests only — no
cmd/serverchanges, no newmap[string]interface{},no CSS, no sinks touched.
Testing
go test ./...incmd/serverandcmd/ingestor: pass.sh test-all.sh: 273/273 files pass.node test-frontend-helpers.js: 727/727 pass.node scripts/check-sqlite3-busy-timeout.js: red (5 violations)before the fix, green after.
node scripts/test-check-sqlite3-busy-timeout.js: 7/7 pass(covers both timeout forms, the missing-timeout case, and
multi-line call matching in both directions).
scripts/check-xss-sinks.sh --diff origin/master: clean (nopublic/**changes).(
corescope-server,corescope-migrate,corescope-ingestor) andtest-fixtures/e2e-fixture.db, same shape as CI:test-region-scope-approval-e2e.js: 11/11 pass.test-channel-proposals-e2e.js: 26/26 pass.test-issue-315-estimated-positions-e2e.js: 3/3 pass.