Skip to content

flake: TestCache_DeploymentStats #961

@blink-so

Description

@blink-so

CI Run Link: https://github.com/coder/coder/actions/runs/17423933022/job/49467317166

Commit Info: ee35ad3a572de87ca04760a1438116906149578b by spikecurtis

Error Analysis:

metricscache_test.go:332: 
    Error Trace:	/home/runner/work/coder/coder/coderd/metricscache/metricscache_test.go:332
    Error:      	Not equal: 
                	expected: 1
                	actual  : 0
    Test:       	TestCache_DeploymentStats

Root Cause:
The test expects the deployment stats count to be 1 but receives 0. This appears to be a timing-related flake where the metrics cache hasn't been updated by the time the assertion runs. The test uses a mock clock and fast intervals, but there may be a race condition between the cache refresh and the assertion.

Related Issues:
This may be related to the broader test reliability epic #871.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions