Skip to content

[CI] Reuse first SQLite fixture construction in five persistence suites - #26231

Merged
nwparker merged 1 commit into
mainfrom
nwparker/persistence-fixture-first-construction
Oct 7, 2026
Merged

nwparker merged 1 commit into
mainfrom
nwparker/persistence-fixture-first-construction

Conversation

@nwparker

@nwparker nwparker commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

ELI5

Five persistence test files repeatedly rebuild the persistence module graph before opening their first database. Reuse the existing test constructor for that first opening so the same checks spend less time loading code.

What Changed

The first Store in each case uses the existing SQLite test harness. Every case still has its own temporary directory, persisted input, real SQLite database, authority, and Store. Later disk reloads still reset and reload modules exactly as before. The existing retirement collision cache is cleared before each case.

Why

Avoid repeating imports rather than caching databases or removing reload checks. Existing tests still cover retirement namespaces, host-scoped repository IDs, pinned automation ownership, workspace repinning, and SSH re-adoption. Their runtime contracts remain on actual Node even when Bun coordinates the test command.

Linked Issue

Maintainer exception from .github/pull_request_template.md: this is internal contributor test-performance work, with no pre-existing issue. The template asks maintainers to avoid opening needless issues.

Visual Proof

N/A — test fixtures only; no application appearance or interaction changes.

Testing

  • Automated tests updated; original assertions and cold reload checks retained.
  • Manually tested application UI — not applicable to test-only changes.

macOS qualification: 209 original cases across 12 related files passed in all eight before/after runs: Bun and Node coordinators, shuffle seeds 104729 and 130363. Exact case identities and statuses, routes, resolved settings, source hashes, normal process close, and recorded coordinator census passed validation. The timed subset is the original 59 cases in these five actual-Node files. Typecheck, changed-code quality, and formatting passed.

Before/after measurements

Whole pnpm test command, macOS, four workers and transform cache disabled in both arms. First measured runs counted; schedule: before0, after0, after1, before1, before2, after2.

Pair Before After
1 6.464309s 5.075668s
2 6.518225s 5.249296s
3 6.759328s 4.890816s
Mean 6.580621s 5.071927s

22.9263% less elapsed time / 1.2975× for these 59 cases, all three pairs improved. All six timings qualified; zero timed attempts rejected or qualified samples discarded. 1 external-coordinator preflight rejection launched no test child. One earlier paperwork preflight also launched no child: a copied unused historical collector retained its parent hash. The old failed record is retained; a fresh template corrected only that digest and artifact label, then the unchanged eight-report validator requalified the same eight reports. No measured sample, source change, settings, or case map was replaced.

Source: 40d35fb7bfcee9b33ff8027bc4a9a44ee1a48f6d; frozen qualification/performance evidence is retained locally under notes/bun-migration/performance/persistence-five-firstctor-40d35-paperwork-fixed-*. This subset gain is not a whole-suite two-times result.

Full CI and review

Full CI run 37635653020 passed on exact head 61a8b98506bdf0b0bbe69b763f7b2816bdfb001e, tested synthetic source 226eb1aba4ad72cbd02fdcabf167cde006596e7c with parents 40d35fb7 + 61a8b985. All 11,678 physical files ran exactly once across five passing shards: 11,538 passed files, 140 existing skipped files; 112,609 passed cases, one expected failure, 1,052 existing skips. No unhandled errors, omitted failures, or added/missing files. All 59 changed cases completed under the actual node-runtime project (34 retirement, 9 SSH re-adoption, 8 pinned fence, 5 host-scope, 3 repinning). Routes: 10,551 Bun, 1,126 actual-Node runtime, one Node measurement; all 18 stock launcher/configuration/registry/setup guards match incoming main. Stock artifacts prove full enrollment/raw totals; the separate local eight-report qualification proves the selected named-case maps.

CodeRabbit review explicitly covers exact head 61a8b985: zero actionable findings and no review comments/open threads. Two advisory warnings assessed before merge: the description now states the template's maintainer issue exception and completed CI; its 33.33% documentation-coverage threshold is not a repository requirement. These existing fixture functions keep their assertions and reload tails; adding boilerplate docstrings solely to reach 80% would conflict with concise comments. The constructor boundary and cleanup rationale are explained above.

Review

Existing canonical constructor and cleanup are reused; no production code, deadlines, test cases, skip conditions, or runtime routing changed. Separate source review checked the first-construction gate, fresh database authority, cache reset, and retained later reload boundaries.

Agent skill upstream boundary

  • Not applicable; no upstream agent-skill source copied.

Notes

No changes to Windows, Linux, SSH execution, folder workspace behavior, or wire compatibility. A subset speedup will not be presented as the full-suite two-times goal.

Checklist

  • Small and focused; mechanism and alternatives explained.
  • N/A visual proof explained.
  • Self-reviewed for correctness, security, and performance.
  • Cross-platform and SSH impact considered.
  • Full CI completed on the final source.

@coderabbitai

coderabbitai Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c1e73811-7422-439a-94f6-0c033f32fffc
📥 Commits

Reviewing files that changed from the base of the PR and between 40d35fb and 61a8b98.

📒 Files selected for processing (5)
  • src/main/persistence-duplicate-repo-id-host-scope.test.ts
  • src/main/persistence-ssh-readoption-automation-migration.test.ts
  • src/main/persistence-workspace-pinned-automation-fence.test.ts
  • src/main/persistence-workspace-repin-automation-owner.test.ts
  • src/main/persistence-worktree-name-retirement.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.


📝 Walkthrough

Walkthrough

Five persistence tests now use shared harness state and create a fresh store on the first store request in each test case. Each test resets its per-case store flag and retirement-collision cache. Later store requests retain their existing module-reset and SQLite setup or reload paths.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to 61a8b

This PR changes persistence-test setup without changing production behavior; each case retains its own store and input. No actionable merge risk is evident; routine CI and bot review checks remain.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: reusing first SQLite fixture construction across five persistence suites.
Description check ✅ Passed The description is complete and focused. It explains the change, rationale, preserved behavior, testing, performance results, CI status, review scope, and template exceptions. It also states that visu…
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@nwparker
nwparker merged commit 76d1b7b into main Oct 7, 2026
30 checks passed
@nwparker nwparker changed the title Reuse first SQLite fixture construction in five persistence suites [CI] Reuse first SQLite fixture construction in five persistence suites Oct 9, 2026
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