Repository navigation
Description
Summary
`crates/cli/tests/manifest_created.rs::manifest_db_created_after_scan` fails intermittently on `windows-latest` because nextest runs CLI test binaries in parallel and several scan-related tests share the same writable volume-root manifest at `C:\.perima\manifest.db`. Linux/macOS are unaffected (`/.perima/` is root-only; manifest write silently fails and the test takes its else-branch).
Reproduction
After commit `19d68c1` filtered the COUNT by tempdir basename, a follow-up Windows run (cdb04c0) showed:
```
thread 'manifest_db_created_after_scan' panicked at crates\cli\tests\manifest_created.rs:141:9:
assertion left == right failed: manifest must have 3 file rows for this tempdir, got 0
left: 0
right: 3
```
Root cause
- `MetadataQueue` / `write_manifest` writes to `<volume_root>/.perima/manifest.db` where volume_root is the mount point of the scan target's volume.
- On Windows GHA runners the tempdir is under `C:\Users\runneradmin\AppData\Local\Temp\` so volume_root resolves to `C:\`. The runner user has write permission to `C:\`.
- Multiple CLI integration test binaries (`scan_persists`, `scan_with_volumes`, `scan_with_metadata_test`, `manifest_created`, etc.) all run `perima scan` concurrently under nextest's process-per-test isolation, all targeting different tempdirs but all writing to the SAME shared manifest at `C:\.perima\manifest.db`.
- The basename-filter fix in `19d68c1` (filter `manifest_files` rows by tempdir basename in `relative_path`) confirms the test's 3 rows are NOT present in the shared manifest after the scan returns success — suggesting a write race where another test binary's transaction clobbered or out-of-ordered our rows.
Workaround applied
Mark the test `#[cfg_attr(target_os = "windows", ignore)]` with a WHY block referencing this issue. Test still runs on Linux/macOS where it's already exercising the else-branch (graceful-degradation path), which is the more interesting invariant.
Real fix candidates (not in this batch)
- Per-test volume-root override env var (`PERIMA_MANIFEST_ROOT`?). Code change in `write_manifest` + tests adopt the env. Would isolate concurrent tests to per-test manifest paths.
- Test serialization for manifest-touching CLI tests (e.g., `#[serial]` macro, opt out of nextest parallelism for this group). Slower but no production code change.
- Run manifest_created in a single-threaded nextest profile (`--test-threads 1`). Cheap; only impacts CI wall-clock for one test.
Activity
test(cli): ignore manifest_created on windows pending #138
arch-audit v0.6.x — checkpoint: Batches F→J landed (#136)