Skip to content

chore: check version.Err() after version.Next() in ConnectToPostgres #18437

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
Jun 18, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutka hugodutka commented Jun 18, 2025

According to version.Next's docstring:

Next prepares the next result row for reading with the [Rows.Scan] method. It returns true on success, or false if there is no next result row or an error happened while preparing it. [Rows.Err] should be consulted to distinguish between the two cases.

I locally reproduced the flake reported in coder/internal#672 and this PR should fix it.

@hugodutka hugodutka marked this pull request as ready for review June 18, 2025 18:57
@hugodutka hugodutka requested a review from sreya June 18, 2025 18:58
Copy link
Collaborator

@sreya sreya left a comment

Choose a reason for hiding this comment

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

This will still result in an error right? So it's not fixing the underlying problem that's surfacing this flake.

@hugodutka
Copy link
Contributor Author

It'll surface the underlying context cancelled error. The test is configured to ignore it.

Copy link
Collaborator

@sreya sreya left a comment

Choose a reason for hiding this comment

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

ahh i see

@hugodutka hugodutka merged commit 4039327 into main Jun 18, 2025
40 checks passed
@hugodutka hugodutka deleted the hugodutka/version-next-pg-flake-fix branch June 18, 2025 19:45
@github-actions github-actions bot locked and limited conversation to collaborators Jun 18, 2025
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