Adjust testWaitForPendingSeqNo
Since we should either remove `testWaitForPendingSeqNo`
or adjust it not to wait for the pending operations. This change picks
the latter.
Relates
@@ -75,7 +75,6 @@ import java.util.concurrent.atomic.AtomicReference;
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.greaterThanOrEqualTo;
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 class RecoveryDuringReplicationTests extends ESIndexLevelReplicationTestC
}
}
- @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 class RecoveryDuringReplicationTests extends ESIndexLevelReplicationTestC
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 class RecoveryDuringReplicationTests extends ESIndexLevelReplicationTestC
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();
