Skip to content

Commit

Permalink
Merge pull request etcd-io#16548 from ahrtr/fix_TestMemberList_20230906
Browse files Browse the repository at this point in the history
test: fix the flaky test case `TestMemberList`
  • Loading branch information
ahrtr authored Sep 6, 2023
2 parents 14ecc7a + 1b87ec4 commit 70fd494
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/common/member_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,18 @@ func TestMemberList(t *testing.T) {
if expectNum != gotNum {
t.Fatalf("number of members not equal, expect: %d, got: %d", expectNum, gotNum)
}
assert.Eventually(t, func() (done bool) {
assert.Eventually(t, func() bool {
resp, err := cc.MemberList(ctx, false)
if err != nil {
t.Logf("Failed to get member list, err: %v", err)
return false
}
for _, m := range resp.Members {
if len(m.ClientURLs) == 0 {
t.Logf("member is not started, memberId:%d, memberName:%s", m.ID, m.Name)
done = false
return done
return false
}
}
done = true
return true
}, time.Second*5, time.Millisecond*100)
})
Expand Down

0 comments on commit 70fd494

Please sign in to comment.