@@ -522,23 +522,21 @@ public void testAutoFollowExclusion() throws Exception {
522522
523523 putAutoFollowPatterns ("my-pattern1" , new String [] {"logs-*" }, Collections .singletonList ("logs-2018*" ));
524524
525+ createLeaderIndex ("logs-201801" , leaderIndexSettings );
526+ AutoFollowStats autoFollowStats = getAutoFollowStats ();
527+ assertThat (autoFollowStats .getNumberOfSuccessfulFollowIndices (), equalTo (0L ));
528+ assertThat (autoFollowStats .getNumberOfFailedFollowIndices (), equalTo (0L ));
529+ assertThat (autoFollowStats .getNumberOfFailedRemoteClusterStateRequests (), equalTo (0L ));
530+ assertFalse (ESIntegTestCase .indexExists ("copy-logs-201801" , followerClient ()));
531+
525532 createLeaderIndex ("logs-201701" , leaderIndexSettings );
526533 assertLongBusy (() -> {
527- AutoFollowStats autoFollowStats = getAutoFollowStats ();
528- assertThat (autoFollowStats .getNumberOfSuccessfulFollowIndices (), equalTo (1L ));
529- assertThat (autoFollowStats .getNumberOfFailedFollowIndices (), equalTo (0L ));
530- assertThat (autoFollowStats .getNumberOfFailedRemoteClusterStateRequests (), equalTo (0L ));
534+ AutoFollowStats autoFollowStatsResponse = getAutoFollowStats ();
535+ assertThat (autoFollowStatsResponse .getNumberOfSuccessfulFollowIndices (), equalTo (1L ));
536+ assertThat (autoFollowStatsResponse .getNumberOfFailedFollowIndices (), greaterThanOrEqualTo (0L ));
537+ assertThat (autoFollowStatsResponse .getNumberOfFailedRemoteClusterStateRequests (), equalTo (0L ));
531538 });
532539 assertTrue (ESIntegTestCase .indexExists ("copy-logs-201701" , followerClient ()));
533-
534- createLeaderIndex ("logs-201801" , leaderIndexSettings );
535- assertLongBusy (() -> {
536- AutoFollowStats autoFollowStats = getAutoFollowStats ();
537- assertThat (autoFollowStats .getNumberOfSuccessfulFollowIndices (), equalTo (1L ));
538- assertThat (autoFollowStats .getNumberOfFailedFollowIndices (), greaterThanOrEqualTo (0L ));
539- assertThat (autoFollowStats .getNumberOfFailedRemoteClusterStateRequests (), equalTo (0L ));
540- });
541-
542540 assertFalse (ESIntegTestCase .indexExists ("copy-logs-201801" , followerClient ()));
543541 }
544542
0 commit comments