You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 434b98c
Browse filesBrowse the repository at this point in the historyBrowse files
tests: attribute scratch-tmpfs watcher events to this process, not co-tenants (#521)
Removes a 1.8.0 cut-run risk: a co-tenant job on the same CI VM could turn these rows red.
## Problem
`test_default_scratch_tmpfs_tmpdir` and `test_jailed_scratch_tmpfs_tmpdir` judge the host-shared `/dev/shm`, `/tmp` and `/var/tmp` by *any* file that appears there during the run (`pineforge-*` for the default row, any name for the jailed row). The watcher never identifies the creator, and `RUN_SERIAL` serialises only one ctest, not the second runner on the same 2-runner post VM. A co-tenant job can therefore turn a green engine run red (and the default row's `/var/tmp` positive claim could false-PASS on a co-tenant's file).
## Change (tests only)
- The tmpfs candidate is a private `mkdtemp` directory under `/dev/shm` owned by the test (RAII cleanup confined to that directory) and is watched strictly.
- In `/tmp` and `/var/tmp`, attribution is exact: the test executable interposes the engine's only temp-file creation path (`mkstemp`, `include/pineforge/detail/scratch_file.hpp:147`, `src/command_scratch_production.cpp:235`) **inside the test executable only**; no engine source, no `include/`, no build flag or option the shipped library sees (CMake changes link `dl`/`Threads` to the three test targets only, Linux only).
- New `tests/test_scratch_watch_attribution.cpp` rows: a planted co-tenant file no longer fails the default or jailed row; a co-tenant file cannot satisfy the positive claim; files this process creates in `/tmp`, `/var/tmp` or `/dev/shm` still fail.
Files touched: `tests/CMakeLists.txt`, `tests/default_scratch_tmpfs_fixture.hpp`, `tests/test_default_scratch_tmpfs_tmpdir.cpp`, `tests/test_jailed_scratch_tmpfs_tmpdir.cpp`, `tests/test_scratch_watch_attribution.cpp` (new). Route: CI-only; promotes no baseline.
## Limit
For the shared roots `/tmp` and `/var/tmp` the negative claim sees only scratch created through `mkstemp` in this process (plus anything created inside the private TMPDIR). A future engine path that creates scratch there with another call (`open(O_CREAT)`, `O_TMPFILE`) would not be seen in those two roots. The positive `/var/tmp` claim and the private-directory watch are not affected. Today the only scratch creators are the two `mkstemp` sites above.
## Evidence
- Linux build host, ctest of the touched targets plus the cmake lane-file checker tests, on the merged tree: job `rj-20261026t054615-1bd154` passed (the same selection passed on the earlier head in `rj-20261026t040636-1f56c7`: 15/15, including both scratch-tmpfs tests, the nine `test_scratch_watch_attribution*` cases, `test_pipe_writer_fd_flags` and `test_cr150_cmake_d` with its controls).
- Red on the base, black-box (job `rj-20261026t050715-5b540a`): the UNCHANGED tests of the base commit run once without interference (green), then again while a separate process creates and removes `pineforge-*` files in `/dev/shm` and `/tmp` throughout the run; a judge that requires the green control and then exit 1 with the watcher's own assertion passed for both rows. This is the co-tenant failure this PR removes.
- Debug and sanitizer profiles of this branch: job `rj-20261026t055037-a75341` passed on the merged tree (debug: 1179 tests, 100%; sanitizers: 1160 tests, 100%, including the scratch-attribution cases and both scratch-tmpfs rows built under the sanitizer interceptors). Main has since gained only unrelated checker-script files.
- Not run on the author's machine.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
0 commit comments