mirror of https://github.com/grpc/grpc-go.git
test: fix race reading while incrementing (#2935)
Swap the `<-done` and `if numConns < 2` to make sure `numConns++` happens before read
This commit is contained in:
parent
b5748caae7
commit
6d6c0413c7
|
|
@ -232,10 +232,10 @@ func (s) TestDialWaitsForServerSettingsAndFails(t *testing.T) {
|
|||
if err != context.DeadlineExceeded {
|
||||
t.Fatalf("DialContext(_) = %v; want context.DeadlineExceeded", err)
|
||||
}
|
||||
<-done
|
||||
if numConns < 2 {
|
||||
t.Fatalf("dial attempts: %v; want > 1", numConns)
|
||||
}
|
||||
<-done
|
||||
}
|
||||
|
||||
// 1. Client connects to a server that doesn't send preface.
|
||||
|
|
|
|||
Loading…
Reference in New Issue