-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
Description
CI Failure Details
- CI Run: https://github.com/coder/coder/actions/runs/21444217040
- Failed Job: https://github.com/coder/coder/actions/runs/21444217040/job/61755356642 (test-go-pg / ubuntu-latest)
- Branch: main
- Commit: e13f2a986901d14d6106d115883a128accf659b1 (author: Steven Masley)
- Date: 2026-01-28 15:32:18Z
Root Cause Classification
- Type: Flaky Test (mock expectation + timeout)
- Affected package: agent/agentcontainers
- Failing test: TestAPI/Delete/OK_with_container_and_subagent
Error Evidence
=== FAIL: agent/agentcontainers TestAPI/Delete/OK_with_container_and_subagent (25.01s)
api.go:1783: Unexpected call to *acmock.MockContainerCLI.DetectArchitecture(...)
expected call at api_test.go:364 has already been called the max number of times
api_test.go:1481: refresh containers failed:
github.com/coder/coder/v2/agent/agentcontainers.(*API).RefreshContainers.func1
/home/runner/work/coder/coder/agent/agentcontainers/api.go:1168
- context deadline exceeded
controller.go:97: missing call(s) to *acmock.MockContainerCLI.Stop(...)
controller.go:97: missing call(s) to *acmock.MockContainerCLI.Remove(...)
Analysis
- The subtest starts the updater loop and injects a subagent, then explicitly calls
api.RefreshContainers(ctx)before issuing the DELETE request. - During refresh, a background updater invocation triggers an extra
DetectArchitecturecall, exceeding the gomock expectation and leading to a context deadline timeout. - The timeout short-circuits the delete flow, so the expected Stop/Remove calls are never observed.
- No panic/OOM or race detector output was observed in this job.
Ownership / Assignment
Primary assignment uses test function blame per guidelines.
Relevant test lines:
- File: agent/agentcontainers/api_test.go
- Subtest: "OK with container and subagent" around line ~1363 (log references api_test.go:1406/1481)
Suggested blame commands:
grep -n "OK with container and subagent" agent/agentcontainers/api_test.go
# -> line ~1363
git blame -L 1363,1460 agent/agentcontainers/api_test.go
Recent change context:
list_commitsfor the file shows commit 44a46db487 ("feat(agent): support deleting dev containers") by Danielle Maywood as the most recent substantive change to delete devcontainer tests; newer commits are import-only.
Assigning to Danielle Maywood for triage.
Related Issues
- flake: agent/agentcontainers TestAPI/Error/DuringInjection #1194 (different test: TestAPI/Error/DuringInjection)
- flake: Data race in agent/agentcontainers - TestAPI/Error/DuringUpWithContainerID #1169 (data race in TestAPI/Error/DuringUpWithContainerID)
Reproduction
go test ./agent/agentcontainers -run TestAPI/Delete/OK_with_container_and_subagent -count=50