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
test: give each launcher-spawning file its own TMPDIR
The launcher writes cache-fix-proxy-<port>.sha256 under os.tmpdir() on every
spawn, and the tests spawn it with `{ ...process.env }`. So each run left those
records in the shared /tmp, and 2,145 had accumulated on this host.
Set once per file rather than at each spawn site, because the env is inherited —
this also covers sites added later, which is what went wrong the first time.
proxy-held-port already had a private TMPDIR at one of its eleven spawn sites,
with a comment explaining exactly why ("Asserting a global path can only ever
measure the machine's history"); the other ten never got it.
Measured with a private TMPDIR per run, before -> after:
proxy-held-port 24 -> 0 (34/34)
proxy-holder-handover 10 -> 0 (11/11)
proxy-wrapper 7 -> 0 (45/45)
stdio-epipe-survival 2 -> 0 (4/4)
proxy-shutdown-once 1 -> 0 (3/3)
proxy-server 0 -> 0 (32/32) consistency, not a fix
The counts include the ccf-runsvc-, ccf-wild- and ccf-v6- directories these
files also left behind, not only the .sha256 records.
proxy-wrapper is a different family from the same cause: runWrapper forks the
wrapper with the inherited env and the launcher writes its scratch CA under
os.tmpdir(), so seven cache-fix-ca-scratch-* dirs survived each run for the seven
days its reaper waits. It goes through that file's own tempDir() registrar rather
than a raw mkdtempSync — the file has a meta-assertion requiring exactly that,
and it caught the first attempt.
In five of the six the cleanup hook is appended at EOF, so it cannot delete the
dir out from under a sweep that reaps ports after the cases: node runs root hooks
in registration order. proxy-wrapper is the exception — its removal rides the
file's existing tempDirs hook near the top, which is harmless there because that
is the file's only root hook, but the property does not hold uniformly.
Co-Authored-By: Claude <noreply@anthropic.com>
0 commit comments