From 86a97533bbe7d84ceb37754b6a1c4e781d6edb45 Mon Sep 17 00:00:00 2001 From: Gaurav Singh Date: Sun, 26 Apr 2020 11:16:25 -0400 Subject: [PATCH] clientv3: fix DialTimeout race condition --- clientv3/client_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clientv3/client_test.go b/clientv3/client_test.go index c085300f1e7..afd2d2b8a49 100644 --- a/clientv3/client_test.go +++ b/clientv3/client_test.go @@ -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)