Skip to content

Commit

Permalink
Fix data race
Browse files Browse the repository at this point in the history
  • Loading branch information
nkryuchkov committed Oct 23, 2019
1 parent 5a9c5be commit 34a461b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/snet/stcp/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,16 @@ func prepareConns(t *testing.T) (*Conn, *Conn, func()) {

var b *Conn
var respErr error
done := make(chan struct{})
go func() {
b, respErr = newConn(bConn, time.Now().Add(HandshakeTimeout), rhs, nil)
close(done)
}()

a, err := newConn(aConn, time.Now().Add(HandshakeTimeout), ihs, nil)
require.NoError(t, err)

<-done
require.NoError(t, respErr)

closeFunc := func() {
Expand Down

0 comments on commit 34a461b

Please sign in to comment.