Skip to content

Commit 27c15d6

Browse files
Fix InternalEngineTests.testSeqNoAndCheckpoints (#51630) (#51672)
* Fix InternalEngineTests.testSeqNoAndCheckpoints If we force flush while possibly triggering a merge the local checkpoint may change from the expectation from the loop that just increments on every operation. Closes #51604
1 parent 2e0ed04 commit 27c15d6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2433,7 +2433,7 @@ public void testSeqNoAndCheckpoints() throws IOException, InterruptedException {
24332433
id = randomFrom(indexedIds);
24342434
final Engine.Delete delete = new Engine.Delete(
24352435
"test", id, newUid(id), UNASSIGNED_SEQ_NO, primaryTerm.get(),
2436-
rarely() ? 100 : Versions.MATCH_ANY, VersionType.INTERNAL, PRIMARY, 0, UNASSIGNED_SEQ_NO, 0);
2436+
rarely() ? 100 : Versions.MATCH_ANY, VersionType.INTERNAL, PRIMARY, System.nanoTime(), UNASSIGNED_SEQ_NO, 0);
24372437
final Engine.DeleteResult result = initialEngine.delete(delete);
24382438
if (result.getResultType() == Engine.Result.Type.SUCCESS) {
24392439
assertThat(result.getSeqNo(), equalTo(primarySeqNo + 1));
@@ -2451,7 +2451,7 @@ public void testSeqNoAndCheckpoints() throws IOException, InterruptedException {
24512451
final Engine.Index index = new Engine.Index(newUid(doc), doc,
24522452
UNASSIGNED_SEQ_NO, primaryTerm.get(),
24532453
rarely() ? 100 : Versions.MATCH_ANY, VersionType.INTERNAL,
2454-
PRIMARY, 0, -1, false, UNASSIGNED_SEQ_NO, 0);
2454+
PRIMARY, System.nanoTime(), -1, false, UNASSIGNED_SEQ_NO, 0);
24552455
final Engine.IndexResult result = initialEngine.index(index);
24562456
if (result.getResultType() == Engine.Result.Type.SUCCESS) {
24572457
assertThat(result.getSeqNo(), equalTo(primarySeqNo + 1));

0 commit comments

Comments
 (0)