clientv3/integration: better way to deflake test
Use ReadyNotify instead of time.Sleep to wait for server ready.
@@ -1011,9 +1011,8 @@ func TestKVForLearner(t *testing.T) {
}
defer cli.Close()
- // TODO: expose servers's ReadyNotify() in test and use it instead.
- // waiting for learner member to catch up applying the config change entries in raft log.
- time.Sleep(3 * time.Second)
+ // wait until learner member is ready
+ <-clus.Members[3].ReadyNotify()
tests := []struct {
op clientv3.Op
