Skip to content

Commit dbc4bf3

Browse files
Flip assertion to expected correct behavior
1 parent 246d40d commit dbc4bf3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

jraft-core/src/test/java/com/alipay/sofa/jraft/core/VotePersistenceBugTest.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,11 @@ public void testDoubleVoteAfterCrashBetweenPersistPhases() throws Exception {
232232
assertTrue(cluster.start(voter.getEndpoint()));
233233
Thread.sleep(1000);
234234

235-
// vote for candidate2 in the same term — should be rejected but is granted (bug)
235+
// vote for candidate2 in the same term — should be rejected
236236
final NodeImpl node2 = (NodeImpl) cluster.getNodes().get(0);
237237
final RequestVoteResponse resp2 = (RequestVoteResponse) node2.handleRequestVoteRequest(buildVoteRequest(
238238
candidate2, voter, 100));
239-
// Bug: double-vote granted; flip to assertFalse after fix
240-
assertTrue("double-vote: node voted for both " + candidate1 + " and " + candidate2 + " in term 100",
239+
assertFalse("double-vote: node voted for both " + candidate1 + " and " + candidate2 + " in term 100",
241240
resp2.getGranted());
242241

243242
cluster.stopAll();

0 commit comments

Comments
 (0)