Skip to content

Record tester scripts into the corpus (npm run record-corpus); the four issue repros - #486

Merged
TimelordUK merged 3 commits into
masterfrom
test/record-corpus
Oct 17, 2026
Merged

TimelordUK merged 3 commits into
masterfrom
test/record-corpus

Conversation

@TimelordUK

Copy link
Copy Markdown
Owner

Stacked on #485. GitHub retargets this to master when #485 is merged.

npm run record-corpus -- <tester.js>

A corpus scenario can now be a script (test/contract/scripts/*.js): an async function that gets one connection and helpers that log in the corpus format. It's for what a single-query scenario can't say: several cases in sequence, or a repro from an issue.

module.exports = async t => {
  t.section('A running cancel')
  t.query('A', BIG, null, { at: { row: { 100: ['cancel'] } } })
  await t.settled('A')
}

The command:

  1. copies the tester into scripts/, so its source is kept beside its transcript;
  2. runs it 3 times, each in its own process, and reports whether it is deterministic;
  3. writes corpus/scripts/<name>.txt and its native recording.

From then on the real-server contract test, the replay and the jittered-timing replay all cover it. The helpers are documented in test/contract/scripts/README.md.

The issue repros

dhensby's repros for #478 – #481 are recorded this way as scripts/issue-478 … -481. Whether an issue is fixed is now a diff on its own transcript. They pin what happens today (unreviewed):

#480 fixed: 51 + 51 rows at pause rows 50, 51 and 52
#481 fixed: strict order on every error path; B2's cancel works
#479 points 4 and 5 fixed. A (done before the cancel callback), B (an extra done on a late cancel) and C (a cancel after a PRINT cancels nothing) are not
#478 not fixed: info 3621 before error 2627 in A – C

As the fixes land, each transcript gets edited to the agreed sequence and marked agreed.

Also

  • The fake sql module inherits the real one's helpers (PollingQuery and the rest).
  • capture.js --exact <name>.
  • The jittered-timing replay in CI includes scripts/.

Testing (Windows, localdb)

  • Contract plus replay suites: 209 passing.
  • Replay alone, including the 4 scripts plain and over two seeds: 126 passing.
  • Explorer over the scripts: 4 of 4 held over 4 timings.

🤖 Generated with Claude Code

…starting with the four issue repros

A scenario can now be a script (test/contract/scripts/*.js): an async
function given one connection and helpers that log in the corpus format
(query, act, settled, section, note). It is for what one query can't say:
several cases in sequence, a repro from an issue.

npm run record-corpus -- <tester.js> copies a script into scripts/, runs it
three times in separate processes, reports whether it is deterministic, and
writes corpus/scripts/<name>.txt and its native recording. The replay and
the jittered-timing replay then cover it like any other scenario.

dhensby's repros for #478 - #481 are recorded this way, as scripts/issue-478
to -481, so whether an issue is fixed is now a diff on its own transcript.
They pin what happens now: #480 and #481 are fixed; #479 A (done before the
cancel callback), B (an extra done on a late cancel) and C (a cancel after a
print cancels nothing) are not, its points 4 and 5 are; #478 is not.

The fake sql module now inherits the real one's helpers (PollingQuery and
the rest), and capture.js has --exact.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@TimelordUK
TimelordUK changed the base branch from test/timing-explorer to master October 17, 2026 15:25
TimelordUK and others added 2 commits October 17, 2026 16:26
On Linux an error at execute followed by a result ends the batch: case D
gives error 2627 more=false and loses the select after it, as
errors/dup-key-d does. Recorded on WSL Fedora, where the other three issue
scripts match Windows exactly.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@TimelordUK
TimelordUK merged commit aa57e17 into master Oct 17, 2026
12 checks passed
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.

1 participant