Skip to content

Commit

Permalink
clientv3/integration: better way to deflake test
Browse files Browse the repository at this point in the history
Use ReadyNotify instead of time.Sleep to wait for server ready.
  • Loading branch information
jingyih committed May 10, 2019
1 parent 2e87a9a commit 90956f7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clientv3/integration/kv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1011,8 +1011,8 @@ func TestKVForLearner(t *testing.T) {
}
defer cli.Close()

// 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
Expand Down

0 comments on commit 90956f7

Please sign in to comment.