Skip to content

Commit 8f3f680

Browse files
Fix InternalEngineTests.testSeqNoAndCheckpoints (#51630)
* 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 2854f5c commit 8f3f680

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -2102,7 +2102,7 @@ public void testSeqNoAndCheckpoints() throws IOException, InterruptedException {
21022102
id = randomFrom(indexedIds);
21032103
final Engine.Delete delete = new Engine.Delete(
21042104
id, newUid(id), UNASSIGNED_SEQ_NO, primaryTerm.get(),
2105-
rarely() ? 100 : Versions.MATCH_ANY, VersionType.INTERNAL, PRIMARY, 0, UNASSIGNED_SEQ_NO, 0);
2105+
rarely() ? 100 : Versions.MATCH_ANY, VersionType.INTERNAL, PRIMARY, System.nanoTime(), UNASSIGNED_SEQ_NO, 0);
21062106
final Engine.DeleteResult result = initialEngine.delete(delete);
21072107
if (result.getResultType() == Engine.Result.Type.SUCCESS) {
21082108
assertThat(result.getSeqNo(), equalTo(primarySeqNo + 1));
@@ -2120,7 +2120,7 @@ id, newUid(id), UNASSIGNED_SEQ_NO, primaryTerm.get(),
21202120
final Engine.Index index = new Engine.Index(newUid(doc), doc,
21212121
UNASSIGNED_SEQ_NO, primaryTerm.get(),
21222122
rarely() ? 100 : Versions.MATCH_ANY, VersionType.INTERNAL,
2123-
PRIMARY, 0, -1, false, UNASSIGNED_SEQ_NO, 0);
2123+
PRIMARY, System.nanoTime(), -1, false, UNASSIGNED_SEQ_NO, 0);
21242124
final Engine.IndexResult result = initialEngine.index(index);
21252125
if (result.getResultType() == Engine.Result.Type.SUCCESS) {
21262126
assertThat(result.getSeqNo(), equalTo(primarySeqNo + 1));

0 commit comments

Comments
 (0)