From 90d28c0de7c3f33e0e24dca057e4e4903622bfd9 Mon Sep 17 00:00:00 2001 From: Jingyi Hu Date: Thu, 18 Apr 2019 14:37:01 -0700 Subject: [PATCH] clientv3/integration: deflake TestKVForLearner Adding delay in the test for the newly started learner member to catch up applying config change entries in raft log. --- clientv3/integration/kv_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/clientv3/integration/kv_test.go b/clientv3/integration/kv_test.go index 432405ddf..9379b6016 100644 --- a/clientv3/integration/kv_test.go +++ b/clientv3/integration/kv_test.go @@ -1004,13 +1004,16 @@ func TestKVForLearner(t *testing.T) { DialTimeout: 5 * time.Second, DialOptions: []grpc.DialOption{grpc.WithBlock()}, } - // this cli only has endpoint of the learner member + // this client only has endpoint of the learner member cli, err := clientv3.New(cfg) if err != nil { t.Fatalf("failed to create clientv3: %v", err) } defer cli.Close() + // waiting for learner member to catch up applying the config change entries in raft log. + time.Sleep(3 * time.Second) + tests := []struct { op clientv3.Op wErr bool