Skip to content

chore: update pull request - #269

Closed
sKeLe100 wants to merge 2 commits into
mainfrom
fm/snapshot-interrupt-test-tmpdir-v2
Closed

sKeLe100 wants to merge 2 commits into
mainfrom
fm/snapshot-interrupt-test-tmpdir-v2

Conversation

@sKeLe100

Copy link
Copy Markdown
Owner

Intent

fm-fleet-snapshot tests: the interrupt-cleanup assertion in tests/fm-fleet-snapshot-view.test.sh (test_interrupted_snapshot_leaves_no_temp_files) requires TMPDIR to be entirely empty after an interrupted bin/fm-fleet-snapshot.sh run, which is overbroad on hosts lacking timeout/perl: the bin/fm-timeout-lib.sh bash fallback leaves fm-bash-timeout-command.* files directly in TMPDIR. An earlier fix, #39, narrowed the assertion to snapshot-owned temp files, but it is months stale (hundreds of commits behind main) and its review raised two findings: the new fallback test skips whenever timeout/gtimeout/perl exist, so it never runs; and one find in the narrowed check is unreachable.

What Changed

Final changed paths and statuses:

M	tests/fm-fleet-snapshot-view.test.sh

Risk Assessment

✅ Low: The change is test-only. It narrows the cleanup assertion to snapshot-owned residue and adds a fallback test that forces the bash timeout path through the real FM_TIMEOUT_MECHANISM_OVERRIDE=bash hook. That test waits for the fallback's own temp file, so it can't pass without reaching the fallback. A negative-control test covers the assertion. I did not run the tests, per review rules.

Testing

Ran the changed test file end to end. The default interrupt test, the new bash-timeout-fallback interrupt test (forced via FM_TIMEOUT_MECHANISM_OVERRIDE=bash, so it does not skip), and the planted-residue negative control all pass. The baseline suite had already passed. The worktree is clean.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Interrupted snapshot on default timeout path leaves no fm-fleet-snapshot.* residue ✅ pass live tests/fm-fleet-snapshot-view.test.sh output
Interrupted snapshot forced onto the bash timeout fallback runs, creates fm-bash-timeout-command.*, and leaves no snapshot residue ✅ pass live tests/fm-fleet-snapshot-view.test.sh output
Residue assertion fails on planted fm-fleet-snapshot.* and ignores fm-bash-timeout-command.* files ✅ pass live tests/fm-fleet-snapshot-view.test.sh output
Evidence: test output
ok - an interrupted snapshot cleans up its temp files
ok - an interrupted snapshot on the bash timeout fallback cleans up its snapshot temp files
ok - the cleanup assertion fails on planted snapshot residue and ignores fallback files

Pipeline

Updates from git push no-mistakes

✅ **Intent** - passed

✅ No issues found.

✅ **Rebase** - passed

✅ No issues found.

✅ **Review** - passed

✅ No issues found.

✅ **Test** - passed

✅ No issues found.

  • Live validation: ✅ go - 3 of 3 scenarios driven live against the product
Scenario Result Live Evidence
Interrupted snapshot on default timeout path leaves no fm-fleet-snapshot.* residue ✅ pass live tests/fm-fleet-snapshot-view.test.sh output
Interrupted snapshot forced onto the bash timeout fallback runs, creates fm-bash-timeout-command.*, and leaves no snapshot residue ✅ pass live tests/fm-fleet-snapshot-view.test.sh output
Residue assertion fails on planted fm-fleet-snapshot.* and ignores fm-bash-timeout-command.* files ✅ pass live tests/fm-fleet-snapshot-view.test.sh output
  • bin/fm-test-run.sh --changed --exclude-family real-herdr-gated --exclude-quarantined --pc02-if-idle
  • bash tests/fm-fleet-snapshot-view.test.sh (full file, exit 0)
✅ **Document** - passed

✅ No issues found.

✅ **Lint** - passed

✅ No issues found.

✅ **Push** - passed

✅ No issues found.

The interrupt-cleanup assertion required TMPDIR to be entirely empty after
an interrupted snapshot. On hosts without timeout, gtimeout, or perl, the
bash timeout fallback in bin/fm-timeout-lib.sh leaves fm-bash-timeout-command.*
files directly in TMPDIR, so the assertion failed for a file the snapshot
does not own.

- Assert only fm-fleet-snapshot.* residue, one level deep under TMPDIR.
- Add a bash-fallback test that forces FM_TIMEOUT_MECHANISM_OVERRIDE=bash
  so it runs on every host, with no skip branch. It seeds one crew row so
  the snapshot reaches a timed collector, and it fails unless the fallback's
  own temp entry appears during the run.
- Add a negative control: planted snapshot residue fails the assertion, and
  fallback files are ignored.
@sKeLe100

Copy link
Copy Markdown
Owner Author

Superseded by #277 (merged).

@sKeLe100 sKeLe100 closed this Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant