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
{{ message }}
Repository navigation
tests: TestHostedWelcomeCarriesUnreadProfileKeysToSurface leaves a writer under its home — TempDir cleanup fails under load #1647
The test passes locally when run alone. The failing folder is the test's second temp dir (the home made by v3TrackedAgent), inside a 16-hex place folder, so something the agent or the loopback engine started is still writing there after the test returns. Only loop.Close() is registered for cleanup.
Replication
Deterministic (no model). Under load:
GOMAXPROCS=2 go test -run '^TestHostedWelcomeCarriesUnreadProfileKeysToSurface$' -count=200 ./cmd/codeaf
Run it with another package's tests beside it. Today a few runs fail on the TempDir cleanup.
Where
TestHostedWelcomeCarriesUnreadProfileKeysToSurface and v3TrackedAgent in cmd/codeaf.
remote.Loopback in internal/remote.
The writer is to be found: something started by the agent or the engine boot that writes under the home's place folder and is not joined by loop.Close() or the agent's cleanup.
The fix
Every goroutine the agent or the loopback engine starts that writes under a home is joined by the close the test already calls, or by the agent's own cleanup, before the TempDir is removed. The test is not changed to tolerate it. A test in this package that fails only under load is a bug report (CLAUDE.md).
Acceptance
Unit: the command above passes 200/200 at GOMAXPROCS=2 with another package's tests running beside it.
Unit: the writer's own close is proven to join it: a test that closes and then asserts nothing is written under the home afterwards.
Activity
remote: a closed loopback has no engine left running, so its home can…