Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix: handle 'connection reset by peer' in postgres test utility
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 <203725896+ibetitsmike@users.noreply.github.com>
  • Loading branch information
blink-so[bot] and ibetitsmike committed Jun 18, 2025
commit 2bc981c8102b7b289f5cb5ce1c5a68b32a3a3834
1 change: 1 addition & 0 deletions coderd/database/dbtestutil/postgres.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func initDefaultConnection(t TBSubset) error {
errSubstrings := []string{
"connection refused", // this happens on Linux when there's nothing listening on the port
"No connection could be made", // like above but Windows
"connection reset by peer", // this happens when PostgreSQL resets the connection
}
errString := dbErr.Error()
for _, errSubstring := range errSubstrings {
Expand Down
Loading