Repository navigation
test: isolate backup scratch roots between test files - #176624
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex review: needs maintainer review before merge. What this changesThis PR gives backup creation and config-capture tests separate temporary roots and removes a redundant case-specific override. Example: Backup creation and config-capture test files run in parallel.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this maintainer-directed fixture repair addresses a recorded CI failure, and inspection found no introduced correctness defect. Priority: P3 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherBackup integration tests construct isolated state, invoke archive creation and restore, and inspect the resulting files; archive creation selects its scratch-maintenance root through os.tmpdir(). flowchart TD
A[Backup creation tests] --> C[Shared test fixture helper]
B[Config capture tests] --> C
C --> D[Per test temporary root]
D --> E[Archive creation and scratch maintenance]
E --> F[Archive and restore assertions]
Technical reviewBest possible solution: Keep fixture isolation in the existing shared test-support module while preserving production staging refusal and all archive assertions. Do we have a high-confidence way to reproduce the issue? The original CI trace confirms retired scratch during config capture, and source exposes the shared-root allocation window; the cross-file timing diagnosis was not independently reproduced during this read-only review. Is this the best way to solve the issue? This is the smallest complete fixture repair: use the existing tracked-directory owner for both affected files, retain their restoration hooks, and remove the superseded override. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7342277809d0. Provenance checked
TestingProof path: none. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceTests +12. Total +12 across 3 files. Added test files: 0. View PR surface stats
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed October 18, 2026, 7:49 PM ET / 23:49 UTC. |
Give backup creation and config capture tests separate tracked temporary roots so scratch maintenance cannot retire another test file's active staging directory. Remove the redundant per-case root override. Production behavior, scratch-refusal protection, and archive/restore assertions are unchanged. Ordinary CI and focused static checks pass; dependency scan findings match scheduled main. Two Codex review rounds found no actionable issues.
What Problem This Solves
Fixes intermittent backup test failures when parallel test files reclaim each other's temporary scratch directories.
Related: #176500
User Impact
No user-visible behavior changes. Backup creation and config-capture tests can run together without sharing their maintenance root.
Why This Change Was Made
Both files previously used the system temporary directory.
maintainBackupScratchin one file could retire a directory created by the other between directory creation and staging-token acquisition, causingSQLite snapshot parent retired; aborting snapshot allocation.Give each test a tracked temporary root through the existing TMPDIR/TMP/TEMP selection, using the existing backup test-support module. Remove the redundant single-case scratch override. Production code, staging refusal, cleanup semantics, and all archive/restore assertions remain unchanged; the existing retired-scratch refusal regression stays intact.
Production LOC: 0 changed. Test LOC: +18/-6 (net +12). No SQL, worker-request, MAIN, or latency change claimed.
Evidence
The original failure is CI job 117803063851: config capture failed while backup creation was running in the same shard. The original Node comparison passed on exact main and the lease-release merge, supporting the cross-file fixture diagnosis rather than a lease-release regression.
Focused type-aware lint, formatting, and diff checks pass. Two independent Codex review rounds are scoped-clean with no actionable findings; the second covers the shared-helper adjustment required by the line-cap hook.
Ordinary exact-head CI passes all 34 selected checks, including type checking, lint, source contracts, architecture, ratchets, all three PostgreSQL conformance shards, and the changed tests. The two fixture files pass 75/75 tests on Bun in that run.
The local paired Node run passes 75/75 tests with backup-create first, both files in one invocation with two workers and an internal-disk TMPDIR. The previously failing external-config case passes while backup-create is active. Worker preparation dominated the 1,093-second run; this is correctness evidence, not a performance measurement. The parent wrapper was interrupted, so its exit code is unavailable; the surviving native child emitted the complete passing summary and completed its cleanup. The paired Bun run also passes 75/75 tests in 458.74 seconds with the same file order and two workers. The existing scratch suite passes 14/14 on Node, including retired-scratch refusal. Bun and scratch wrappers both exit 0; all task-owned test processes have settled.
Supplemental dependency scan: all 87 diagnostic lines are present on scheduled main, with zero new findings. Unused exports: production 61 versus main 62, full-tree 36 versus main 39, scripts 0 versus 0. The remaining supplemental work was cancelled after collecting that missing gate. An earlier supplemental dispatch rejected incompatible main-validation and PR-release-gate options in preflight; the corrected dispatch above supplied the evidence without a code change.