clientv3: fix DialTimeout race condition

release-3.5
Gaurav Singh 2020-04-26 11:16:25 -04:00
parent 59f5fb25a5
commit 86a97533bb
1 changed files with 2 additions and 2 deletions

View File

@ -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)