diff --git a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java index 87068836d0945..474341429a84f 100644 --- a/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java +++ b/server/src/test/java/org/elasticsearch/index/replication/RecoveryDuringReplicationTests.java @@ -75,7 +75,6 @@ import java.util.stream.Collectors; import static org.hamcrest.Matchers.anyOf; -import static org.hamcrest.Matchers.both; import static org.hamcrest.Matchers.empty; import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.everyItem; @@ -83,7 +82,6 @@ import static org.hamcrest.Matchers.is; import static org.hamcrest.Matchers.isIn; import static org.hamcrest.Matchers.lessThan; -import static org.hamcrest.Matchers.lessThanOrEqualTo; import static org.hamcrest.Matchers.not; public class RecoveryDuringReplicationTests extends ESIndexLevelReplicationTestCase { @@ -441,17 +439,7 @@ public void testResyncAfterPrimaryPromotion() throws Exception { } } - @TestLogging( - "_root:DEBUG," - + "org.elasticsearch.action.bulk:TRACE," - + "org.elasticsearch.action.get:TRACE," - + "org.elasticsearch.cluster.service:TRACE," - + "org.elasticsearch.discovery:TRACE," - + "org.elasticsearch.indices.cluster:TRACE," - + "org.elasticsearch.indices.recovery:TRACE," - + "org.elasticsearch.index.seqno:TRACE," - + "org.elasticsearch.index.shard:TRACE") - public void testWaitForPendingSeqNo() throws Exception { + public void testDoNotWaitForPendingSeqNo() throws Exception { IndexMetaData metaData = buildIndexMetaData(1); final int pendingDocs = randomIntBetween(1, 5); @@ -525,7 +513,7 @@ public void indexTranslogOperations( final int indexedDuringRecovery = shards.indexDocs(randomInt(5)); docs += indexedDuringRecovery; - assertFalse("recovery should wait on pending docs", opsSent.get()); + assertBusy(() -> assertFalse("recovery should not wait for on pending docs", opsSent.get())); primaryEngineFactory.releaseLatchedIndexers(); pendingDocsDone.await(); @@ -534,10 +522,6 @@ public void indexTranslogOperations( recoveryFuture.get(); assertThat(newReplica.recoveryState().getIndex().fileDetails(), empty()); - assertThat(newReplica.recoveryState().getTranslog().recoveredOperations(), - // we don't know which of the inflight operations made it into the translog range we re-play - both(greaterThanOrEqualTo(docs-indexedDuringRecovery)).and(lessThanOrEqualTo(docs))); - shards.assertAllEqual(docs); } finally { primaryEngineFactory.close();