Relationships
#4483 telemetry_workflow_method_invocations_test can leave its swamp-tel-wf-test temp dir behind, failing verify-build's leftover check
Opened by zack · 11/6/2026
What
In verify-build for swamp-club#4480 (run db70fdda-095c-452a-bc40-e2490a405e7a, commit 00531035c), run-tests reported all 36638 tests passing but exited 1 because the temp-dir leak check found:
Tests left these temp entries behind in /tmp/swamp-verify-build-<run-id>-tmp; remove each when its test ends:
swamp-tel-wf-test-af89da0f8208c655The prefix comes from withTempDir in integration/telemetry_workflow_method_invocations_test.ts. It deletes the directory in a finally, after spawning the CLI as a child process (runCli) that runs repo init and a workflow with telemetry pinned to http://127.0.0.1:1.
Likely cause
Something the child CLI starts (a telemetry flush, or another background writer) appears to write under the test dir (XDG_CONFIG_HOME or HOME are inside it) after the parent's Deno.remove, recreating the directory. Not confirmed.
Expected
The test waits for anything the child started to finish before removing its dir, so it is correct under the verify-build leftover check and deno test --repeats.
Where
- integration/telemetry_workflow_method_invocations_test.ts (withTempDir, runCli)
Unrelated to the #4480 change (renderer and docs only); found during its verification.
Closed
No activity in this phase yet.
zack commented 11/6/2026, 10:50:19 PM
Closing as unreproducible.
Investigation:
- The suggested cause (a background writer started by the child CLI) does not hold. strace -f of both child invocations (repo init, workflow run) shows only git and one short sh -c per workflow step, all exiting before the CLI exits. Nothing outlives the child. The only detached spawn in src is the Litestream supervisor, which a local datastore never starts.
- The child teardown work (telemetry flush, old-entry cleanup, flush record) runs in-process and dies with the child.
- No other test uses the swamp-tel-wf-test prefix or calls Deno.chdir.
- The test cleanup throws when the recursive remove fails, so a passing test means the remove succeeded; something recreated the dir afterwards and no candidate was found.
Reproduction attempts, all clean: 40 sequential repeats, plus 80 runs across 10 concurrent loops sharing one TMPDIR, checked again 5s after finishing.
If it recurs, reopen with the contents of the leftover dir (which subpaths came back) so the writer can be identified. The longer-term fix would be moving this test in-process: it spawns the CLI as a subprocess, which AGENTS.md says integration tests must not do.
Sign in to post a ripple.