7575import java .util .stream .Collectors ;
7676
7777import static org .hamcrest .Matchers .anyOf ;
78- import static org .hamcrest .Matchers .both ;
7978import static org .hamcrest .Matchers .empty ;
8079import static org .hamcrest .Matchers .equalTo ;
8180import static org .hamcrest .Matchers .everyItem ;
8281import static org .hamcrest .Matchers .greaterThanOrEqualTo ;
8382import static org .hamcrest .Matchers .is ;
8483import static org .hamcrest .Matchers .isIn ;
8584import static org .hamcrest .Matchers .lessThan ;
86- import static org .hamcrest .Matchers .lessThanOrEqualTo ;
8785import static org .hamcrest .Matchers .not ;
8886
8987public class RecoveryDuringReplicationTests extends ESIndexLevelReplicationTestCase {
@@ -440,17 +438,7 @@ public void testResyncAfterPrimaryPromotion() throws Exception {
440438 }
441439 }
442440
443- @ TestLogging (
444- "_root:DEBUG,"
445- + "org.elasticsearch.action.bulk:TRACE,"
446- + "org.elasticsearch.action.get:TRACE,"
447- + "org.elasticsearch.cluster.service:TRACE,"
448- + "org.elasticsearch.discovery:TRACE,"
449- + "org.elasticsearch.indices.cluster:TRACE,"
450- + "org.elasticsearch.indices.recovery:TRACE,"
451- + "org.elasticsearch.index.seqno:TRACE,"
452- + "org.elasticsearch.index.shard:TRACE" )
453- public void testWaitForPendingSeqNo () throws Exception {
441+ public void testDoNotWaitForPendingSeqNo () throws Exception {
454442 IndexMetaData metaData = buildIndexMetaData (1 );
455443
456444 final int pendingDocs = randomIntBetween (1 , 5 );
@@ -524,7 +512,7 @@ public void indexTranslogOperations(
524512 final int indexedDuringRecovery = shards .indexDocs (randomInt (5 ));
525513 docs += indexedDuringRecovery ;
526514
527- assertFalse ("recovery should wait on pending docs" , opsSent .get ());
515+ assertBusy (() -> assertFalse ("recovery should not wait for on pending docs" , opsSent .get () ));
528516
529517 primaryEngineFactory .releaseLatchedIndexers ();
530518 pendingDocsDone .await ();
@@ -533,10 +521,6 @@ public void indexTranslogOperations(
533521 recoveryFuture .get ();
534522
535523 assertThat (newReplica .recoveryState ().getIndex ().fileDetails (), empty ());
536- assertThat (newReplica .recoveryState ().getTranslog ().recoveredOperations (),
537- // we don't know which of the inflight operations made it into the translog range we re-play
538- both (greaterThanOrEqualTo (docs -indexedDuringRecovery )).and (lessThanOrEqualTo (docs )));
539-
540524 shards .assertAllEqual (docs );
541525 } finally {
542526 primaryEngineFactory .close ();
0 commit comments