Skip to content

flake: TestAwaitSubagentCompletion/CompletesViaPubsub (api.example.com DNS failure) #1549

@flake-investigator

Description

@flake-investigator

CI Failure Details

CI Run: https://github.com/coder/coder/actions/runs/26516935180
Failed Job: https://github.com/coder/coder/actions/runs/26516935180/job/78096757402 (test-go-race-pg, attempt 1)
Commit: 38c3f54020c32ac6dd45f5cf786d8ac0a5ded49d (Ethan) coder/coder@38c3f54
Date: 2026-05-27

Failing Test

  • coderd/x/chatd TestAwaitSubagentCompletion/CompletesViaPubsub
  • File: coderd/x/chatd/subagent_internal_test.go:3488
  • Code path: coderd/x/chatd/subagent.go:1364 (handleSubagentDone)

Error Output

processor: failed to process chat  chat_id=e84c5a5f-0954-4bb6-8bd8-48e5b4f8335c  error="stream response: Post \"https://api.example.com/responses\": dial tcp: lookup api.example.com on 127.0.0.53:53: no such host"
subagent_internal_test.go:3488:
    Error:       Received unexpected error:
                 agent reached error status
    github.com/coder/coder/v2/coderd/x/chatd.handleSubagentDone
        /home/runner/work/coder/coder/coderd/x/chatd/subagent.go:1364

Error Analysis

The chat processor attempted a real provider call to https://api.example.com/responses, which failed DNS resolution (no such host). That error sets the child chat to error, so awaitSubagentCompletion returns agent reached error status, failing the pubsub completion assertion.

Root Cause Assessment

Likely flaky test / external dependency in the chatd subagent path: the test environment is permitting a real network lookup to api.example.com, and CI DNS resolution failed. This suggests a missing mock/stub or reliance on external DNS in the test setup.

Assignment Analysis

Intended blame command:

  • git blame -L 3252,3520 coderd/x/chatd/subagent_internal_test.go

Proxy via history (available tooling):

  • git log --oneline -10 --follow coderd/x/chatd/subagent_internal_test.go
    • Most recent substantive change touching this test path: 8b1705e (Michael Suchacz)
  • git log --oneline -10 --follow coderd/x/chatd/subagent.go
    • Most recent substantive change: 8b1705e (Michael Suchacz)

Assigning to @ibetitsmike as the most recent modifier of this test path.

Data race / crash checks

Searched logs for WARNING: DATA RACE, panic:, and OOM indicators; none found.

Related Issues

Reproduction

go test ./coderd/x/chatd -run TestAwaitSubagentCompletion/CompletesViaPubsub -race -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