Skip to content

Commit

Permalink
*: make TestLeaderAndVoter stable (#8609)
Browse files Browse the repository at this point in the history
close #8408

Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx authored Sep 10, 2024
1 parent 8733b55 commit e27e55b
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions tests/server/api/rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -985,13 +985,7 @@ func (suite *ruleTestSuite) checkLeaderAndVoter(cluster *tests.TestCluster) {
tu.StatusOK(re), tu.ExtractJSON(re, &respBundle))
re.NoError(err)
re.Len(respBundle, 1)
if bundle[0].Rules[0].Role == placement.Leader {
return respBundle[0].Rules[0].Role == placement.Leader
}
if bundle[0].Rules[0].Role == placement.Voter {
return respBundle[0].Rules[0].Role == placement.Voter
}
return false
return compareBundle(respBundle[0], bundle[0])
})
}
}
Expand Down

0 comments on commit e27e55b

Please sign in to comment.