Skip to content

flake: Test_TaskSend/WaitsForInitializingTask #1609

Description

@flake-investigator

CI Run Link: https://github.com/coder/coder/actions/runs/28177254482
Failing Job: https://github.com/coder/coder/actions/runs/28177254482/job/83460105609 (test-go-race-pg)

Commit Info:

  • SHA: 1efdc56cbbea9fc53817fc18f8ece46a65864713
  • Author: Susana Ferreira
  • Commit title: chore(dogfood): rename AI Bridge to AI Gateway in dogfood templates (#26655)

Failure Evidence:

clitest.go:299: command "coder task send" exited with error: <nil>
task_test.go:557: unexpected call to POST /chat/completions - no handler defined
--- FAIL: Test_TaskSend/WaitsForInitializingTask (7.07s)

Error Analysis:

  • The fake agent API used by TaskSend tests only registers /status and /message handlers (cli/task_send_test.go -> fakeAgentAPITaskSendOK; cli/task_test.go -> startFakeAgentAPI).
  • During Test_TaskSend/WaitsForInitializingTask, a POST /chat/completions request hit the fake agent API, triggering the default handler failure (cli/task_test.go:557).
  • No data race warnings (“WARNING: DATA RACE” / “race detected during execution of test”) found in the job logs around the failure.
  • No panic/OOM indicators found in the job logs.

Root Cause Classification:
A. Flaky Test (unexpected /chat/completions request during task send flow)

Precise Assignment Analysis:

  • Failing test located in cli/task_send_test.go subtest Test_TaskSend/WaitsForInitializingTask (~lines 118-178).
  • git log --oneline -10 --follow cli/task_send_test.go shows the most recent substantive changes in this test area are:
    • 6ecf804 (Mathias Fredriksson) "test(cli): eliminate race in PausedDuringWaitForReady test"
    • 7958ad6 (Mathias Fredriksson) "fix(cli): use quartz clock in waitForTaskIdle for immediate first poll"
  • cli/task_test.go (startFakeAgentAPI) last changed in 4cf8d441 (Danielle Maywood) as part of task send/resume functionality.
  • Assigning to @mafredri as the most recent substantive modifier in the TaskSend test area.

Related Issues:

Reproduction:

  • go test ./cli -run 'Test_TaskSend/WaitsForInitializingTask' -count=50

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