Repository navigation
Closed
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ciCI workflows, the gates they run, release scripts, packaging.priority: p1Scheduled into the current or next milestone.type: choreTooling, CI, release plumbing, dependencies.
Milestone
Description
Context
Main went red 25 times between 2026-11-02 and 2026-11-16. Reading the PRs that cleared each incident, about 18 changed only a test: a wait, a pinned clock, a readiness signal, a deadline a loaded shard can meet (#3366, #3460, #3546, #3585, #3736, #3760, #3778, #3802, #3820, #3846, #3954, #3999, #4082, #4099). Around six were product defects. The first-main failure rate is about the same for PRs under 100 lines (19%) as for PRs over 2,000 lines (22%), which points at tests that pass once and fail later on someone else's merge.
Nothing runs a new or changed test more than once before it merges. Maintainer decision, 2026-11-16: gate changed tests on repeated runs under CPU load.
Scope
- A command,
bun scripts/test-determinism.ts --base <ref>, with--json:- selects the Bun test files the change adds or modifies against its merge base;
- runs each selected file several times through the existing offline test wrapper (Bun's
--rerun-each, verified against the pinned Bun), while busy loops occupy the CPUs; - fails on the first failing repetition and names the file, the repetition and the failing case.
- Bounded. A default of five repetitions and a fixed time budget. When the reviewed weights say five do not fit, repetitions drop uniformly to a floor of two. A selected file is never skipped silently: the report lists each file with the repetitions it actually got.
- A hosted job,
determinism, selected by the planner whenever the change adds or modifies a Bun test file. It runs at every pull-request cadence, so the fast lane's newest run includes it, and in draft heavy feedback.draft gatesandproofrequire it when selected. It is a fast category in the hybrid split. - No local burn by default.
check:prdoes not run it; it names the command in--plan. The host is shared. - Docs. Record the ruling in
docs/decisions/ci-utility.md(it amends "drafts run cheap gates only" for this one job), and describe the gate indocs/process/test-authoring.mdanddocs/process/testing.md.
Out of scope
- Browser, layout and story specs run by Vitest in the pinned container. File the follow-up for repeating those; do not label it
agent-readyuntil it has acceptance criteria. - Repeating unchanged tests, or any retry that turns a failure green.
- Changing any test deadline.
Acceptance criteria
- A fixture test that fails one run in a few (a race on a real-time wait) fails the command, with the file and repetition named. The same fixture made deterministic passes. Both receipts are in the PR.
- Removing the repetition (one run only) lets the racy fixture pass often enough that the named test fails: the mutation receipt.
- A change that touches no Bun test file does not select the job, and the aggregates do not require it.
- A selection that cannot fit the budget at five repetitions reports the reduced count per file and still runs every file at least twice.
- The job passes on the PR that adds it, which changes test files.
- The repetitions run with the offline preload active. A fixture that attempts a non-loopback connection fails.
Verification
bun run check:pr --base origin/main.- The PR's own
determinismjob, linked.
Contract impact
None. CI tooling only.
Metadata
Metadata
Assignees
Labels
agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ciCI workflows, the gates they run, release scripts, packaging.priority: p1Scheduled into the current or next milestone.type: choreTooling, CI, release plumbing, dependencies.
Activity
schlessera commentedon Nov 16, 2026
Claimed for implementation. Claim token:
claim-080d4d1e. Branch:chore/4109-test-determinism-gate.none; shared CI files (ci.yml, ci-plan.ts, check-ci-workflows.ts, ci-utility.md) are edited narrowly
test(ci): prove selection validation and the merge path require deter…
test(ci): keep fixture job summaries out of the hosted summary (#4109)
fix(ci): read Bun's GitHub Actions log-group headers in the repetitio…
chore(ci): retire browser proof retention and repeat changed tests un…