Skip to content

Commit a8ebe2a

Browse files
authored
Fix random params in testSoftDeletesRetentionLock (#38114)
Since #37992 the retainingSequenceNumber is initialized with 0 while the global checkpoint can be -1. Relates #37992
1 parent 291c4e7 commit a8ebe2a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

server/src/test/java/org/elasticsearch/index/engine/SoftDeletesPolicyTests.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public void testSoftDeletesRetentionLock() {
7474
// Advances the global checkpoint and the local checkpoint of a safe commit
7575
globalCheckpoint.addAndGet(between(0, 1000));
7676
for (final AtomicLong retainingSequenceNumber : retainingSequenceNumbers) {
77-
retainingSequenceNumber.set(randomLongBetween(retainingSequenceNumber.get(), globalCheckpoint.get()));
77+
retainingSequenceNumber.set(randomLongBetween(retainingSequenceNumber.get(), Math.max(globalCheckpoint.get(), 0L)));
7878
}
7979
safeCommitCheckpoint = randomLongBetween(safeCommitCheckpoint, globalCheckpoint.get());
8080
policy.setLocalCheckpointOfSafeCommit(safeCommitCheckpoint);

0 commit comments

Comments
 (0)