Skip to content

Commit 0169965

Browse files
authored
FIx testReplicaIgnoresOlderRetentionLeasesVersion (#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 #37951 Closes #38245
1 parent db24e5c commit 0169965

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)