Skip to content

Commit 1ec04df

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 475a045 commit 1ec04df

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
@@ -340,8 +340,8 @@ public void testReplicaIgnoresOlderRetentionLeasesVersion() {
340340
for (int j = 0; j < innerLength; j++) {
341341
leases.add(
342342
new RetentionLease(i + "-" + j, randomNonNegativeLong(), randomNonNegativeLong(), randomAlphaOfLength(8)));
343-
version++;
344343
}
344+
version++;
345345
if (rarely()) {
346346
primaryTerm++;
347347
}

0 commit comments

Comments
 (0)