Repository navigation
fix: avoid missed SQLite allocation events in config tests - #158798
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: needs maintainer review before merge. Reviewed September 26, 2026, 6:04 AM ET / 10:04 UTC. ClawSweeper reviewWhat this changesThe PR replaces filesystem watch events with a staging-directory timestamp check in the config tests for temporary SQLite snapshot allocation. Merge readiness✅ Ready for maintainer review Current main still uses the flaky filesystem watcher. The related Gateway fix has merged, but it did not repair this assertion; the focused test change has no actionable finding. Priority: P3 Review scores
Verification
How this fits togetherConfig loading reads deferred plugin-migration records from local SQLite. These tests check that ordinary reads avoid temporary database copies while artifact-preserving reads create them without changing source database files. flowchart LR
A[Deferred migration records] --> B[Config read]
B --> C{Artifact-preserving read?}
C -->|No| D[Read existing SQLite]
C -->|Yes| E[Create private snapshot]
D --> F[Check staging timestamp]
E --> F
F --> G[Test result]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceTests -10. Total -10 across 1 file. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep the timestamp assertion as the config suite’s allocation signal, alongside its existing real SQLite, migration-freshness, and source-artifact checks. Do we have a high-confidence way to reproduce the issue? No deterministic, high-confidence reproduction was established in this read-only review. Current main retains the watcher, and the PR reports failures on an unchanged baseline plus a macOS dropped-event probe. Is this the best way to solve the issue? Yes. A directory timestamp retains evidence of transient child creation after cleanup, while the test keeps its worker-call, migration-freshness, and source-byte checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against facd3957cd5f. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
What Problem This Solves
Fixes intermittent config test failures when the filesystem drops watch events for SQLite snapshot directories that are created and removed before notification.
User Impact
No user-visible behavior change. Config tests retain reliable checks for avoiding snapshot allocations during ordinary reads and creating them for artifact-preserving reads.
Why This Change Was Made
Replace the filesystem watcher and polling wait with an old modification-time marker on the test-isolated staging directory. Creating and removing entries changes that marker even after cleanup. Keep the real SQLite freshness checks, synchronous snapshot-worker checks, and existing database/WAL/SHM byte-preservation coverage. No production code changes.
Evidence
fs.watchcan report no events.089a9d409fea76642d1b1edf766733fd0fd589fe. Its Linux changed-test job ran this file: 17/17 passed in 33.95 seconds wrapper wall; the two repaired cases took 254 ms and 224 ms.pnpm test src/config/io.load-async.test.ts --maxWorkers=1: 17/17 passed, 86.05 seconds wall on the loaded local host; Vitest duration 74.36 seconds, with 24% in tests. The unchanged file's real worker startup and SQLite integration account for its existing cost.Related: #158783. This separately repairs the pre-existing test failure found while validating that change.