Skip to content

postgresql: various test fixes#4308

Open
mmatczuk wants to merge 5 commits intomainfrom
mmt/postgresql-fixes-v2
Open

postgresql: various test fixes#4308
mmatczuk wants to merge 5 commits intomainfrom
mmt/postgresql-fixes-v2

Conversation

@mmatczuk
Copy link
Copy Markdown
Contributor

Commits

  • fix data race in Stream.Stop() on pgConn
  • filter context.Canceled from streamOut.Run in test goroutine
  • ignore expected context.Canceled from stream Run in test goroutine
  • tolerate context.Canceled in heartbeat test stream goroutine
  • tolerate context.Canceled in txn markers test stream goroutine

Jira

  • CON-406
  • CON-422
  • CON-433
  • CON-442

Stop() was closing pgConn concurrently with streamMessages() still
using it for ReceiveMessage and SendStandbyStatusUpdate. Wait for the
stream goroutine to exit (HasStoppedChan) before closing the connection.

Fixes CON-406
streamOut.Run correctly returns context.Canceled when the test context
is cancelled at shutdown. Use the same filtered error check pattern
already used elsewhere in the file.

Fixes CON-422
…goroutine

The second stream goroutine in TestIntegrationPostgresNoTxnMarkers asserted
no error on streamOut.Run(t.Context()), but Run returns context.Canceled when
the test ends and the context is canceled. Use _ = to match the first goroutine.

Fixes CON-433
@claude
Copy link
Copy Markdown

claude Bot commented Apr 20, 2026

Commits
LGTM

Review
Stop() race fix waits for streamMessages to release pgConn before closing it — addresses the documented race on pgconn internal state. Test goroutine cleanups filter context.Canceled consistent with patterns already used elsewhere in the file.

LGTM

This was referenced Apr 20, 2026
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.

2 participants