From cce7ddac97a344fbd1cfe99b6364abd3e2fa6b61 Mon Sep 17 00:00:00 2001 From: Nhat Nguyen Date: Thu, 20 Sep 2018 13:09:27 -0400 Subject: [PATCH] Remove wrong assert in LocalCheckpointTrackerTests It's possible for the set "seqNos" to contain only the "unFinishedSeq" in the testConcurrentReplica test. If this is the case, the call `randomValueOtherThan` won't make any progress because the predicate will never be false. This commit removes this expectation because it's incorrect and it's no longer needed as we have a dedicated test to verify the contains method. Relates #33871 --- .../elasticsearch/index/seqno/LocalCheckpointTrackerTests.java | 1 - 1 file changed, 1 deletion(-) diff --git a/server/src/test/java/org/elasticsearch/index/seqno/LocalCheckpointTrackerTests.java b/server/src/test/java/org/elasticsearch/index/seqno/LocalCheckpointTrackerTests.java index aef31a16110a8..789a60ec55dba 100644 --- a/server/src/test/java/org/elasticsearch/index/seqno/LocalCheckpointTrackerTests.java +++ b/server/src/test/java/org/elasticsearch/index/seqno/LocalCheckpointTrackerTests.java @@ -218,7 +218,6 @@ protected void doRun() throws Exception { } assertThat(tracker.getMaxSeqNo(), equalTo(maxOps - 1L)); assertThat(tracker.getCheckpoint(), equalTo(unFinishedSeq - 1L)); - assertThat(tracker.contains(randomValueOtherThan(unFinishedSeq, () -> (long) randomFrom(seqNos))), equalTo(true)); assertThat(tracker.contains(unFinishedSeq), equalTo(false)); tracker.markSeqNoAsCompleted(unFinishedSeq); assertThat(tracker.getCheckpoint(), equalTo(maxOps - 1L));