Skip to content

fix(conformance): clean up after an unexpected failure; stop kill hitting the process group - #102

Merged
zcsizmadia merged 1 commit into
mainfrom
fix/conformance-cleanup
Sep 5, 2026
Merged

zcsizmadia merged 1 commit into
mainfrom
fix/conformance-cleanup

Conversation

@zcsizmadia

Copy link
Copy Markdown
Collaborator

Closes #78. Three defects in the batteries' own housekeeping.

kill 0 signals the process group. fs-conformance.sh expanded its pids as "\0". A bare 0 is not a harmless default — kill 0 signals the whole process group, which is the shell running the script and, in CI, the step around it. Both pids are now guarded and killed only when set.

No cleanup on an unexpected error. fs-conformance.ps1 runs with ErrorActionPreference = Stop and had nothing around its body, so anything unexpected outside a Check left the drive letter mounted and the agent running — and the next run then could not take that letter. A trap reports the error, runs Cleanup and exits 97. It covers the whole body without wrapping and re-indenting it.

A file left in /tmp every run. The content matches check copied through \/../cmp.bin, outside the served tree on purpose (writing inside it would show up on the mount and disturb later checks) — but that also put it outside everything cleanup removes. It now has its own scratch directory, which cleanup takes with it.

Verification

  • Windows battery still 28/0. With a failure injected after the mount: trap fires, exit 97, no mounted drive and no wsldrive processes left.
  • Linux battery 31/0, and no /tmp/cmp.bin or stray temp directories afterwards.

The performance notes on the same issue (per-op allocations, select-per-frame, Stats counters as atomics) are deliberately not here — measured at under 3%, and a separate change.

🤖 Generated with Claude Code

… hitting the process group

Three defects in the batteries' own housekeeping.

fs-conformance.ps1 runs with ErrorActionPreference = Stop and had no handler
around its body, so anything unexpected outside a Check - a missing binary, a
path that vanished - terminated the script with the drive letter still mounted
and the agent still running. The next run then could not take that letter. A
`trap` now reports the error, runs Cleanup and exits 97; it covers the whole
body without wrapping and re-indenting it.

fs-conformance.sh expanded its pids as "${AGENT_PID:-0}". A bare 0 is not a
harmless default: `kill 0` signals the entire process group, which is the shell
running the script and, in CI, the step around it. Both pids are now guarded and
killed only when actually set.

The `content matches` check copied through "$WORK/../cmp.bin" - deliberately
outside the served tree, since writing inside it would show up on the mount and
disturb later checks, but that also put it outside everything cleanup removes,
so every run left a file in /tmp. It now uses its own scratch directory, which
cleanup takes with it.

Verified: the Windows battery still passes 28/0, and with a failure injected
after the mount the trap fires, exits 97, and leaves no mounted drive and no
wsldrive processes behind. The Linux battery passes 31/0 and leaves no
/tmp/cmp.bin and no stray temp directories.

The performance notes on the same issue (per-op allocations in fuse_mount.cpp,
select-per-frame, Stats counters as atomics) are deliberately not in here: they
were measured at under 3% and are a separate change.

Closes #78

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@zcsizmadia zcsizmadia added the ci label Sep 5, 2026
@zcsizmadia
zcsizmadia merged commit cc1634a into main Sep 5, 2026
6 checks passed
@zcsizmadia
zcsizmadia deleted the fix/conformance-cleanup branch September 5, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tests: conformance scripts should clean up on unexpected errors; minor hardening

1 participant