Skip to content

Commit

Permalink
Merge pull request #11819 from gaurav1086/fix_race_cond_client_test
Browse files Browse the repository at this point in the history
clientv3: fix DialTimeout race condition
  • Loading branch information
philips authored Apr 28, 2020
2 parents 262c939 + 86a9753 commit eddca8d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clientv3/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ func TestDialTimeout(t *testing.T) {

for i, cfg := range testCfgs {
donec := make(chan error, 1)
go func() {
go func(cfg Config) {
// without timeout, dial continues forever on ipv4 black hole
c, err := New(cfg)
if c != nil || err == nil {
t.Errorf("#%d: new client should fail", i)
}
donec <- err
}()
}(cfg)

time.Sleep(10 * time.Millisecond)

Expand Down

0 comments on commit eddca8d

Please sign in to comment.