Repository navigation
flake: TestSubscribeError/Flush #1617
Copy link
Copy link
Closed
coder/coder
#27238Labels
Description
CI Run Link: https://github.com/coder/coder/actions/runs/29236112377
Failing Job: https://github.com/coder/coder/actions/runs/29236112377/job/86771135015 (test-go-pg (ubuntu-latest))
Failure time: 2026-07-13T08:52:09Z (same window as Slack alert)
Commit Info:
- SHA: 1497ba14fe760c99c371a87056faa4642c6178ed
- Author: Ethan
- Commit: coder/coder@1497ba1
Failure evidence:
=== FAIL: coderd/x/nats TestSubscribeError/Flush (0.00s)
t.go:114: 2026-07-13 08:49:20.348 [erro] failed to unsubscribe after error subscribing event=foo error="nats: connection closed" ...
previous_error= flush subscribe:
github.com/coder/coder/v2/coderd/x/nats.(*Pubsub).subscribeGroup
/home/runner/work/coder/coder/coderd/x/nats/pubsub.go:756
- assert.AnError general error for testing
pubsub_internal_test.go:594:
Error Trace: /home/runner/work/coder/coder/coderd/x/nats/pubsub_internal_test.go:594
Error: Should be empty, but was map[foo:0x90912dc3340]
Test: TestSubscribeError/Flush
Error analysis:
TestSubscribeError/Flushexpectsps.subscriptionsto be empty after a failed subscribe/flush path, but a subscription forfooremains.- The log shows
nats: connection closedduring unsubscribe after the error, which likely leaves stale state inps.subscriptions.
Root cause classification:
- Flaky test / timing/cleanup issue in NATS pubsub subscribe error handling (state not fully cleaned up when connection closes after error).
Data race / panic / OOM checks:
- No
WARNING: DATA RACE,panic:, or OOM indicators observed in the failing job log tail.
Precise assignment analysis:
- Failing test function:
coderd/x/nats/pubsub_internal_test.golines ~556-600 (TestSubscribeErrorwithFlushsubtest)
- Intended blame command:
git blame -L 556,600 coderd/x/nats/pubsub_internal_test.go
- Recent file history (best available via git log):
Assignment:
- Best candidate: @sreya (recent NATS pubsub work and prior NATS flakes assigned here; please reassign if ownership differs)
Related issues search (coder/internal):
- "TestSubscribeError" / "SubscribeError/Flush" / "nats: connection closed" / "pubsub_internal_test.go" / "coderd/x/nats"
- No matching open issues found.
- Nearby NATS flakes (different tests): flake: TestPubsub_Metrics #1607, flake: Test_localSub_init/CrossSubjectListenerIsolation #1552.
Reproduction (best effort):
go test ./coderd/x/nats -run TestSubscribeError/Flush -count=1
Reactions are currently unavailable
Activity
linear-code commentedon Jul 13, 2026
ENG-3031