Skip to content

Commit 6fb5733

Browse files
committed
FIx testReplicaIgnoresOlderRetentionLeasesVersion (elastic#38246)
If the innerLength is 0, the version won't be increased; then there will be two RetentionLeases with the same term and version, but their leases are different. Relates elastic#37951 Closes elastic#38245
1 parent cca86ea commit 6fb5733

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/test/java/org/elasticsearch/index/seqno/ReplicationTrackerRetentionLeaseTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,8 +339,8 @@ public void testReplicaIgnoresOlderRetentionLeasesVersion() {
339339
for (int j = 0; j < innerLength; j++) {
340340
leases.add(
341341
new RetentionLease(i + "-" + j, randomNonNegativeLong(), randomNonNegativeLong(), randomAlphaOfLength(8)));
342-
version++;
343342
}
343+
version++;
344344
if (rarely()) {
345345
primaryTerm++;
346346
}

0 commit comments

Comments
 (0)