Skip to content

Commit

Permalink
Fix random params in testSoftDeletesRetentionLock (elastic#38114)
Browse files Browse the repository at this point in the history
Since elastic#37992 the retainingSequenceNumber is initialized with 0 
while the global checkpoint can be -1.

Relates elastic#37992
  • Loading branch information
dnhatn committed Feb 1, 2019
1 parent 7077cb3 commit 024647b
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void testSoftDeletesRetentionLock() {
// Advances the global checkpoint and the local checkpoint of a safe commit
globalCheckpoint.addAndGet(between(0, 1000));
for (final AtomicLong retainingSequenceNumber : retainingSequenceNumbers) {
retainingSequenceNumber.set(randomLongBetween(retainingSequenceNumber.get(), globalCheckpoint.get()));
retainingSequenceNumber.set(randomLongBetween(retainingSequenceNumber.get(), Math.max(globalCheckpoint.get(), 0L)));
}
safeCommitCheckpoint = randomLongBetween(safeCommitCheckpoint, globalCheckpoint.get());
policy.setLocalCheckpointOfSafeCommit(safeCommitCheckpoint);
Expand Down

0 comments on commit 024647b

Please sign in to comment.