Make sure all goroutines have ended before restoring global vars. (#1732)
This commit is contained in:
@ -169,11 +169,12 @@ func TestDialWaitsForServerSettings(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestCloseConnectionWhenServerPrefaceNotReceived(t *testing.T) {
|
func TestCloseConnectionWhenServerPrefaceNotReceived(t *testing.T) {
|
||||||
defer leakcheck.Check(t)
|
|
||||||
mctBkp := minConnectTimeout
|
mctBkp := minConnectTimeout
|
||||||
|
// Call this only after transportMonitor goroutine has ended.
|
||||||
defer func() {
|
defer func() {
|
||||||
minConnectTimeout = mctBkp
|
minConnectTimeout = mctBkp
|
||||||
}()
|
}()
|
||||||
|
defer leakcheck.Check(t)
|
||||||
minConnectTimeout = time.Millisecond * 500
|
minConnectTimeout = time.Millisecond * 500
|
||||||
server, err := net.Listen("tcp", "localhost:0")
|
server, err := net.Listen("tcp", "localhost:0")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
Reference in New Issue
Block a user