Eliminate intermittent JetStream TempDir teardown race #542

Closed
opened 2026-10-27 13:36:44 +00:00 by sam · 0 comments
Owner

An intermittent full-suite race failure shows TestConnectAndPublish cleaning its testing.TempDir while JetStream is still removing the ARCHIE_TASKS msgs directory. The package subsequently passed five race iterations, so the timing window is narrow.\n\n## Steps to Reproduce\n1. Run: go test -race -count=1 ./...\n2. Repeat until internal/nats TestConnectAndPublish fails during TempDir RemoveAll with: unlinkat .../jetstream/$G/streams/ARCHIE_TASKS/msgs: directory not empty.\n3. Compare with: go test -race -count=5 ./internal/nats.\n\nMake embedded NATS shutdown and storage cleanup deterministic before TempDir cleanup.

Acceptance Criteria

Repeated race runs of internal/nats and the full repository do not race TempDir cleanup against JetStream file removal; the test explicitly waits for server/storage shutdown.


Imported from beads archie-core-1786637490173-15-39c844b1 · GitHub #36 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08

An intermittent full-suite race failure shows TestConnectAndPublish cleaning its testing.TempDir while JetStream is still removing the ARCHIE_TASKS msgs directory. The package subsequently passed five race iterations, so the timing window is narrow.\n\n## Steps to Reproduce\n1. Run: go test -race -count=1 ./...\n2. Repeat until internal/nats TestConnectAndPublish fails during TempDir RemoveAll with: unlinkat .../jetstream/$G/streams/ARCHIE_TASKS/msgs: directory not empty.\n3. Compare with: go test -race -count=5 ./internal/nats.\n\nMake embedded NATS shutdown and storage cleanup deterministic before TempDir cleanup. ### Acceptance Criteria Repeated race runs of internal/nats and the full repository do not race TempDir cleanup against JetStream file removal; the test explicitly waits for server/storage shutdown. --- _Imported from beads `archie-core-1786637490173-15-39c844b1` · GitHub #36 · type bug · priority P2 · created 2026-08-08 · closed 2026-08-08_
sam added the mediumbug labels 2026-10-27 13:36:44 +00:00
sam self-assigned this 2026-10-27 13:36:44 +00:00
sam closed this issue 2026-10-27 13:36:44 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#542