Thanks to visit codestin.com
Credit goes to github.com

Skip to content

flake: TestGetWorkspaceAgentUsageStatsAndLabels/Aggregates #447

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ethanndickson opened this issue Mar 3, 2025 · 0 comments · Fixed by coder/coder#16773
Closed

flake: TestGetWorkspaceAgentUsageStatsAndLabels/Aggregates #447

ethanndickson opened this issue Mar 3, 2025 · 0 comments · Fixed by coder/coder#16773
Assignees

Comments

@ethanndickson
Copy link
Member

https://github.com/coder/coder/actions/runs/13623011640/job/38075570842

 === Failed
=== FAIL: coderd/database TestGetWorkspaceAgentUsageStatsAndLabels/Aggregates (0.02s)
    querier_test.go:797: 
        	Error Trace:	C:/a/coder/coder/coderd/database/querier_test.go:797
        	Error:      	[]database.GetWorkspaceAgentUsageStatsAndLabelsRow{database.GetWorkspaceAgentUsageStatsAndLabelsRow{Username:"focused_shamir57", AgentName:"infallible_lederberg69", WorkspaceName:"focused_goldberg82", RxBytes:3, TxBytes:3, SessionCountVSCode:1, SessionCountSSH:0, SessionCountJetBrains:1, SessionCountReconnectingPTY:1, ConnectionCount:0, ConnectionMedianLatencyMS:1}, database.GetWorkspaceAgentUsageStatsAndLabelsRow{Username:"boring_volhard84", AgentName:"vigilant_chatelet87", WorkspaceName:"lucid_pare93", RxBytes:8, TxBytes:4, SessionCountVSCode:1, SessionCountSSH:1, SessionCountJetBrains:0, SessionCountReconnectingPTY:0, ConnectionCount:0, ConnectionMedianLatencyMS:1}} does not contain database.GetWorkspaceAgentUsageStatsAndLabelsRow{Username:"focused_shamir57", AgentName:"infallible_lederberg69", WorkspaceName:"focused_goldberg82", RxBytes:3, TxBytes:3, SessionCountVSCode:0, SessionCountSSH:0, SessionCountJetBrains:1, SessionCountReconnectingPTY:1, ConnectionCount:0, ConnectionMedianLatencyMS:1}
        	Test:       	TestGetWorkspaceAgentUsageStatsAndLabels/Aggregates

Totally at a loss as to how this could be flaking. The test is a bunch of calls to synchronous dbgen functions, and then a direct call to a dbmem query. Maybe some Windows weirdness? Though doesn't explain why the test only started flaking a few months later.

@ethanndickson ethanndickson self-assigned this Mar 3, 2025
ethanndickson added a commit to coder/coder that referenced this issue Mar 3, 2025
Closes coder/internal#447.

The test was failing 30% of the time on Windows without the rounding
applied by `dbtime`. `dbtime` was used on the timestamps inserted into
the DB, but not within the query. Once using `dbtime` within the query
there were no failures in 200 runs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant