Skip to content

Commit

Permalink
Actually fix race
Browse files Browse the repository at this point in the history
  • Loading branch information
zachmu committed Nov 21, 2023
1 parent 748a835 commit 9da4ac3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions postgres/connection/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ func TestReceive(t *testing.T) {
var receivedMessage connection.Message
go func() {
defer wg.Done()
var err error
receivedMessage, err = connection.Receive(serverConn)
require.NoError(t, err)
}()
Expand Down Expand Up @@ -147,13 +148,15 @@ func getLocalHostConnection(t *testing.T) (net.Conn, net.Conn) {
var serverConn net.Conn
go func() {
defer wg.Done()
var err error
serverConn, err = ln.Accept()
require.NoError(t, err)
}()

var clientConn net.Conn
go func() {
defer wg.Done()
var err error
clientConn, err = net.Dial("tcp", ln.Addr().String())
require.NoError(t, err)
}()
Expand Down

0 comments on commit 9da4ac3

Please sign in to comment.