Skip to content

flake: TestGetUserStatusCounts #464

@ethanndickson

Description

@ethanndickson
Member

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

Activity

johnstcn

johnstcn commented on Mar 10, 2025

@johnstcn
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
),
added theissue type on Mar 10, 2025
changed the issue type fromtoon Apr 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    No branches or pull requests

      Participants

      @johnstcn@SasSwart@ethanndickson

      Issue actions

        flake: `TestGetUserStatusCounts` · Issue #464 · coder/internal