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

Skip to content

test: ignore slog errors in TestUserLatencyInsights #15105

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

Merged
merged 1 commit into from
Oct 16, 2024
Merged

Conversation

mtojek
Copy link
Member

@mtojek mtojek commented Oct 16, 2024

Spotted in: https://github.com/coder/coder/actions/runs/11362544440/job/31604644424

It looks like TestUserLatencyInsights failed due to a random error while reporting agent stats:

    t.go:108: 2024-10-16 09:13:08.529 [erro]  workspacestats: failed to load template schedule bumping activity, defaulting to bumping by 60min  request_id=4ca1de78-75d9-44ca-a1d9-73d9aa32ced7  workspace_id=6a1b979a-b432-4f6b-8985-974ee66c7be3  template_id=47d60e91-9e06-4c1f-ad6e-735e02c63cce ...
        error= fetch object:
                   github.com/coder/coder/v2/coderd/database/dbauthz.(*querier).GetTemplateByID.fetch[...].func1
                       /home/runner/work/coder/coder/coderd/database/dbauthz/dbauthz.go:427
                 - pq: canceling statement due to user request
         *** slogtest: log detected at level ERROR; TEST FAILURE ***

@mtojek mtojek self-assigned this Oct 16, 2024
@mtojek mtojek requested a review from johnstcn October 16, 2024 11:10
@mtojek mtojek marked this pull request as ready for review October 16, 2024 11:10
Copy link
Member

@johnstcn johnstcn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use slogtest.IgnoredErrorIs: []error{pq.ErrCanceled} or similar instead?

@mtojek
Copy link
Member Author

mtojek commented Oct 16, 2024

I might be wrong, but it seems there isn't anything equivalent to pq.ErrCanceled. These are all I found:

// Common error types
var (
	ErrNotSupported              = errors.New("pq: Unsupported command")
	ErrInFailedTransaction       = errors.New("pq: Could not complete operation in a failed transaction")
	ErrSSLNotSupported           = errors.New("pq: SSL is not enabled on the server")
	ErrSSLKeyUnknownOwnership    = errors.New("pq: Could not get owner information for private key, may not be properly protected")
	ErrSSLKeyHasWorldPermissions = errors.New("pq: Private key has world access. Permissions should be u=rw,g=r (0640) if owned by root, or u=rw (0600), or less")

	ErrCouldNotDetectUsername = errors.New("pq: Could not detect default username. Please provide one explicitly")

	errUnexpectedReady = errors.New("unexpected ReadyForQuery")
	errNoRowsAffected  = errors.New("no RowsAffected available after the empty statement")
	errNoLastInsertID  = errors.New("no LastInsertId available after the empty statement")
)

@mtojek mtojek merged commit 21feb42 into main Oct 16, 2024
30 checks passed
@mtojek mtojek deleted the fix-flaky-insights branch October 16, 2024 11:20
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants