Skip to content

flake: TestPubsub_Metrics #1607

Description

@flake-investigator

CI Run Link: https://github.com/coder/coder/actions/runs/28162827287
Failing Job: https://github.com/coder/coder/actions/runs/28162827287/job/83410409640 (test-go-pg (ubuntu-latest))
Failure time: 2026-06-25T10:38:45Z (same window as Slack alert)

Commit Info:

  • SHA: 1ae96fcf8af361448b7fa40732841bda40303e08
  • Author: Danielle Maywood
  • Commit: coder/coder@1ae96fc

Failure evidence:

=== FAIL: coderd/x/nats TestPubsub_Metrics (10.05s)
    metrics_test.go:84:
        Error:       Condition never satisfied
        Test:        TestPubsub_Metrics
    t.go:111: 2026-06-25 10:36:05.425 [info]  embedded nats server started  client_url=nats://127.0.0.1:36355
    t.go:111: 2026-06-25 10:36:15.446 [info]  nats server shut down
DONE 26850 tests, 63 skipped, 1 failure in 333.357s

Error analysis:

  • Single failing test in coderd/x/nats/metrics_test.go.
  • The require.Eventually at metrics_test.go:84 timed out waiting for expected Prometheus metric values (pubsub counters/gauges/latency) after publish/subscribe activity.
  • No panic/OOM indicators observed in the job logs around the failure.

Root cause classification: Flaky test (timing-sensitive metrics collection / eventual consistency in NATS pubsub metrics).

Assignment analysis:

  • Intended blame target:
    • git blame -L 15,118 coderd/x/nats/metrics_test.go (covers TestPubsub_Metrics).
  • File history:
    • git log --oneline -10 --follow coderd/x/nats/metrics_test.go shows the test was introduced in commit 6da322d (PR #26441) by @sreya.
    • No other commits touch this file, so blame falls to the initial test introduction.

Assignee: @sreya

Related issues search (coder/internal):

  • "TestPubsub_Metrics"
  • "coderd/x/nats" "metrics_test.go"
  • "coder_nats_pubsub" / "Condition never satisfied"
    No duplicates found.

Reproduction (best effort):

go test ./coderd/x/nats -run TestPubsub_Metrics -count=1

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions