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

Skip to content

flake: TestGetUserStatusCounts #464

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

Open
ethanndickson opened this issue Mar 10, 2025 · 1 comment
Open

flake: TestGetUserStatusCounts #464

ethanndickson opened this issue Mar 10, 2025 · 1 comment
Assignees
Labels

Comments

@ethanndickson
Copy link
Member

ethanndickson commented Mar 10, 2025

Looks like this test has broken with the US moving to daylight savings, it only runs with postgres and it's failed on all postgres-using CI jobs.
https://github.com/coder/coder/actions/runs/13752449408
https://github.com/coder/coder/actions/runs/13756567387

e.g.

=== FAIL: coderd/database TestGetUserStatusCounts/America/New_York/User_deleted_during_query_range (0.53s)
    t.go:106: 2025-03-09 21:04:28.690 [debu]  pubsub: pubsub dialing postgres  network=tcp  address=127.0.0.1:5432  timeout_ms=0
    t.go:106: 2025-03-09 21:04:28.690 [debu]  pubsub: pubsub postgres TCP connection established  network=tcp  address=127.0.0.1:5432  timeout_ms=0  elapsed_ms=0
    t.go:106: 2025-03-09 21:04:28.716 [debu]  pubsub: pubsub connected to postgres
    t.go:106: 2025-03-09 21:04:28.716 [debu]  pubsub: pubsub has started
    querier_test.go:3334: 
        	Error Trace:	/home/runner/work/coder/coder/coderd/database/querier_test.go:3334
        	Error:      	Not equal: 
        	            	expected: 0
        	            	actual  : 1
        	Test:       	TestGetUserStatusCounts/America/New_York/User_deleted_during_query_range
    t.go:106: 2025-03-09 21:04:29.077 [info]  pubsub: pubsub is closing
    t.go:106: 2025-03-09 21:04:29.077 [info]  pubsub: pubsub listen stopped receiving notify
    t.go:106: 2025-03-09 21:04:29.077 [debu]  pubsub: pubsub closed
@johnstcn
Copy link
Member

This part of GetUserStatusCounts looks sus:

WITH
	-- dates_of_interest defines all points in time that are relevant to the query.
	-- It includes the start_time, all status changes, all deletions, and the end_time.
dates_of_interest AS (
	SELECT date FROM generate_series(
		@start_time::timestamptz,
		@end_time::timestamptz,
		(CASE WHEN @interval::int <= 0 THEN 3600 * 24 ELSE @interval::int END || ' seconds')::interval
	) AS date
),

mtojek added a commit to coder/coder that referenced this issue Mar 10, 2025
mtojek added a commit to coder/coder that referenced this issue Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants