mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
clientv3: fix DialTimeout race condition
This commit is contained in:
parent
59f5fb25a5
commit
86a97533bb
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user