What
test (hub N/3) shards on v5 intermittently fail with:
TempDir RemoveAll cleanup: .../ws-state: directory not empty
in TestLeaseRestart_ResumeSurvivesHubRestart: the contribute-ws hub is still writing lease/state files when t.TempDir() tears the directory down. Seen on runs 33945861132 (v5 branch) and 34037083450 before today's PRs existed, and again on #6214 on 2026-09-08, so it is independent of the change under test.
Ask
Make the test stop the hub (and wait for its writer goroutines to exit) before returning, e.g. a t.Cleanup that calls the hub's shutdown and blocks on its done channel, registered after the TempDir so it runs first. No time.Sleep (TestSleepRatchet is at its baseline). Add a -race -count=3 run of this test to the PR body as evidence.
Related: #6282 (same class of teardown race in pkg/agent).
🤖 Generated with Claude Code
https://claude.ai/code/session_01TmdVsn5zULh5KVpFkYrX59
What
test (hub N/3)shards on v5 intermittently fail with:in
TestLeaseRestart_ResumeSurvivesHubRestart: the contribute-ws hub is still writing lease/state files whent.TempDir()tears the directory down. Seen on runs 33945861132 (v5 branch) and 34037083450 before today's PRs existed, and again on #6214 on 2026-09-08, so it is independent of the change under test.Ask
Make the test stop the hub (and wait for its writer goroutines to exit) before returning, e.g. a
t.Cleanupthat calls the hub's shutdown and blocks on its done channel, registered after the TempDir so it runs first. Notime.Sleep(TestSleepRatchet is at its baseline). Add a-race -count=3run of this test to the PR body as evidence.Related: #6282 (same class of teardown race in pkg/agent).
🤖 Generated with Claude Code
https://claude.ai/code/session_01TmdVsn5zULh5KVpFkYrX59