Skip to content

Commit

Permalink
Make sure all goroutines have ended before restoring global vars. (gr…
Browse files Browse the repository at this point in the history
  • Loading branch information
MakMukhi authored Dec 14, 2017
1 parent 4742c42 commit b8cf13e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion clientconn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,12 @@ func TestDialWaitsForServerSettings(t *testing.T) {
}

func TestCloseConnectionWhenServerPrefaceNotReceived(t *testing.T) {
defer leakcheck.Check(t)
mctBkp := minConnectTimeout
// Call this only after transportMonitor goroutine has ended.
defer func() {
minConnectTimeout = mctBkp
}()
defer leakcheck.Check(t)
minConnectTimeout = time.Millisecond * 500
server, err := net.Listen("tcp", "localhost:0")
if err != nil {
Expand Down

0 comments on commit b8cf13e

Please sign in to comment.