Rust tests leave illogical-test-<pid>-<n> state dirs in /tmp #68
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found during #55 (while fixing #62).
/tmp on geek holds about 1,650 directories named illogical-test-- (about 17 per test run), each a daemon state dir (blocks/, daemon-id, layout.json, push/, shell/, sock). They come from crates/daemon/tests/attach.rs temp_state() (and the same name in upgrade.rs). TempState's Drop calls remove_dir_all, so the likely cause is the daemon (or a pane's shell) still writing there when it runs: e.g. the Daemon is dropped after its TempState, or the daemon saves layout.json on its way out after the directory is gone.
Next steps: check drop order in attach.rs/upgrade.rs (kill and wait for the daemon before removing its state), and retry remove_dir_all once the child has exited, as fake-fleet.ts does.
Fixed in main (
356fbcf, from1e412d7). Cause: a pane's shim outlives the test daemon and appendssignal Ntoblocks/<id>/processwhen the program dies. If that lands duringremove_dir_all,blocks/<id>isn't empty and the delete gives up.strays::removenow kills, waits for the shims to record the end, and retries the delete; every teardown uses it. Also fixed: the forge tests' scratch dirs (38 per run) and dialout's token dirs (4 per run) were never deleted. Measured: 3 leftovers in 10 runs of attach+upgrade before, 0 in 20 after; 0 left by three fullcargo test -p illogicaldruns and a full workspace run.