Flake batch 27: dirty-pages VFS copies, inspect dedup deadline, storage-scoped free-space overrides

Merged
AF
1d ago
+410-60

Three test-only fixes for intermittent failures that kept knocking PRs out of the merge queue. No product behavior changes.

1. Dirty-pages measurement VFS: one methods copy per open file (views::materialization::tests::dirty_pages::session_keeps_default_and_wal_probe_isolated, macOS, twice). The test-only measurement VFS cached copied I/O method tables by the source table's address. The accounting VFS it wraps keeps a methods table inside each file, so that address is reused after a file closes. A main database could then inherit a closed journal's table, which has no xShmMap, and SQLite refuses to enter WAL with "unable to open database file". Each open now gets its own copy, which is restored and freed on close. A deterministic regression reuses one source address across a no-shared-memory close and a WAL-capable reopen, and fails on the old cache. The original CI failure didn't reproduce in 576 macOS runs. Failures now print the path, iteration and SQLite extended code.

2. Inspect dedup test: 30 s soft deadline (inspect_engine_test::inspect_engine_deduplicates_in_flight_waiters, Windows). The test checks that two waiters share one worker job, and that held (worker count 1). Its 2 s soft deadline was a latency bound the test doesn't need: on a loaded runner the first waiter passed 2 s for a 150 ms job and got a pending answer. The deadline is now 30 s, and each assertion prints the outcome it got.

3. v3 free-space test override scoped by storage root (views::trigram setup failing beside migration tests in one process). A process-global free-space override, set low by migration refusal tests and never restored, was read by unrelated trigram setup on other threads (device_free_space_floor). Overrides are now keyed by storage root, with raw and canonical spellings both matching and the most specific root winning. They apply on every thread and are restored on drop, including on unwind. The shared fixture fallback is parameterless and can only mean unlimited, so it can never cause a refusal. All 24 explicit callers name their storage. Tests cover cross-thread isolation, same-storage cross-thread probes, nested and sibling roots, symlinked roots, and restore on unwind.

Verified on the build server: 254 v3, views import, migration, trigram, call-graph and materialization library tests, 36 v3 and inspect integration tests, formatting and the Windows compile check.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need.


Summary by cubic

Fixes three test flake sources that kept knocking PRs out of the merge queue; no product behavior changes.

Bug Fixes

  • Dirty-pages measurement VFS now copies its I/O methods table per open file and restores it on close, so a reopened main database can't inherit a journal's table without xShmMap and have SQLite reject WAL.
  • Inspect dedup test raises its soft deadline from 2 s to 30 s; the old bound was a latency limit the test doesn't need.
  • v3 free-space test overrides are now keyed by storage root and restored on drop, including unwind, so low-space refusal tests no longer leak into unrelated trigram setup on other threads.