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.
This commit is contained in:
@ -1004,13 +1004,16 @@ func TestKVForLearner(t *testing.T) {
|
|||||||
DialTimeout: 5 * time.Second,
|
DialTimeout: 5 * time.Second,
|
||||||
DialOptions: []grpc.DialOption{grpc.WithBlock()},
|
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)
|
cli, err := clientv3.New(cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("failed to create clientv3: %v", err)
|
t.Fatalf("failed to create clientv3: %v", err)
|
||||||
}
|
}
|
||||||
defer cli.Close()
|
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 {
|
tests := []struct {
|
||||||
op clientv3.Op
|
op clientv3.Op
|
||||||
wErr bool
|
wErr bool
|
||||||
|
Reference in New Issue
Block a user