Skip to content

flake: TestWorkspaceAgentListeningPorts/OK_BlockDirect #1387

@flake-investigator

Description

@flake-investigator

Failure Details

CI Run Link: https://github.com/coder/coder/actions/runs/22766143397
Failed Job: test-go-pg (ubuntu-latest)
Commit: eb1d194447fb7585f3600b043d912b45a9c45545 (Danielle Maywood)
Date: 2026-03-06

Error

workspaceagents_test.go:1288:
    Error Trace: /home/runner/work/coder/coder/coderd/workspaceagents_test.go:1288
    Error:       Received unexpected error:
                 Get "http://127.0.0.1:46361/api/v2/workspaceagents/0b6b2a98-7d69-4ee6-9d65-fb8eaa50c46f/listening-ports": context deadline exceeded
    Test:        TestWorkspaceAgentListeningPorts/OK_BlockDirect

coderd: GET /api/v2/workspaceagents/.../listening-ports -> 500
response_body: {
  "message": "Internal error fetching listening ports.",
  "detail": "do request: Get \"http://[fd7a:115c:a1e0:4ee6:9d65:fb8e:aa50:c46f]:4/api/v0/listening-ports\": context canceled"
}

Analysis

The OK_BlockDirect subtest timed out while calling WorkspaceAgentListeningPorts. The server returned a 500 after ~19s because the agent-side request to /api/v0/listening-ports was canceled. This looks like a flaky timeout or tailnet/DERP connectivity issue when BlockDirect is enabled, rather than a deterministic test assertion failure.

No panic/OOM or data race markers observed in the logs.

Assignment Analysis

Unable to run git blame directly, so used commit history for the test file:

  • git log --oneline -10 --follow coderd/workspaceagents_test.go
  • Most recent meaningful change to TestWorkspaceAgentListeningPorts is commit afd40436f0d5 ("fix: mock Agent querying OS for listening ports in tests (#20842)") by Spike Curtis, which refactored the listening-ports tests and introduced the mocked getter used in this subtest.

Assigning to @spikecurtis as the most recent significant modifier of this test.

Root Cause Classification

Flaky Test / Timeout — intermittent timeout contacting the agent listening-ports endpoint when BlockDirect is enabled.

Related Issues

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions