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
This commit is contained in:
Nhat Nguyen 2019-02-02 02:37:37 -05:00 committed by GitHub
parent 475a045192
commit 1ec04dff43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -340,8 +340,8 @@ public class ReplicationTrackerRetentionLeaseTests extends ReplicationTrackerTes
for (int j = 0; j < innerLength; j++) {
leases.add(
new RetentionLease(i + "-" + j, randomNonNegativeLong(), randomNonNegativeLong(), randomAlphaOfLength(8)));
version++;
}
version++;
if (rarely()) {
primaryTerm++;
}