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

Skip to content

fix: handle 'connection reset by peer' in postgres test utility #18423

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
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

blink-so[bot]
Copy link
Contributor

@blink-so blink-so bot commented Jun 18, 2025

This PR fixes the flaky PostgreSQL connection issue reported in coder/internal#695.

Problem

Tests were failing with "connection reset by peer" errors when trying to connect to PostgreSQL. The current error handling logic only recognized "connection refused" and "No connection could be made" as reasons to start a new postgres container, but didn't handle connection resets.

Solution

Added "connection reset by peer" to the list of error strings that should trigger starting a new postgres container in the test utility.

Testing

  • Verified the code compiles successfully
  • The fix follows the existing pattern for error handling in the same function

Fixes coder/internal#695

Add 'connection reset by peer' to the list of errors that should trigger
starting a new postgres container in the test utility. This fixes flaky
tests that fail when PostgreSQL resets connections.

Fixes: coder/internal#695

Co-authored-by: ibetitsmike <[email protected]>
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 this pull request may close these issues.

flake: postgresql connection reset
0 participants