Skip to content

flake: TestSubscribeAfterMessageID #1489

@flake-investigator

Description

@flake-investigator

CI Run

Commit

Failure

=== FAIL: coderd/x/chatd TestSubscribeAfterMessageID (0.39s)
    chatd_test.go:3847:
        Error:       "[{message d28d5bcb-96af-410c-9955-278ca826287b 0xc0006fd730 <nil> <nil> <nil> <nil> [] <nil>} {message d28d5bcb-96af-410c-9955-278ca826287b 0xc0006fd7a0 <nil> <nil> <nil> <nil> [] <nil>}]" should have 1 item(s), but has 2
        Messages:    afterMessageID=msg2.ID should return only messages after msg2

Error Analysis

  • Test inserts three messages (initial user message + two manual inserts), then subscribes with afterMessageID=msg2.ID.
  • Snapshot filtering returned two message events instead of one, indicating an extra message (likely msg2 or duplicate) was included in the snapshot.
  • No panic/OOM indicators or data race warnings observed in the job logs.

Root Cause Assessment

  • Flaky test / snapshot filtering inconsistency in Subscribe when afterMessageID is used (duplicate or off-by-one message inclusion).

Assignment Analysis

  • Failing test function: coderd/x/chatd/chatd_test.go lines ~3757-3847 (TestSubscribeAfterMessageID).
  • Unable to run git blame via API tooling; used recent file history instead:
    • git log --oneline -10 --follow coderd/x/chatd/chatd_test.go → most recent subscribe-related stabilization commit: b3d5b8d ("fix: stabilize flaky chatd subscribe/promote queued tests") by Kyle Carberry.
  • Assigning to the most recent substantive modifier of chatd subscribe tests: @kylecarbs.

Related Issues

Searched coder/internal for:

  • "TestSubscribeAfterMessageID"
  • "afterMessageID"
  • "chatd_test.go"
  • "chatd subscribe message"

Related but not duplicates:

  • CODAGT-81 (closed) flake: chatd subscribe/promote queued (different tests, prior fix)
  • ENG-2524 (open) chatd tests failed without specific output (different failure mode)

Reproduction

go test ./coderd/x/chatd -run TestSubscribeAfterMessageID -count=1

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions