From c875ba999f37e031c06848140beac3bd05a6d336 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Fri, 11 Jan 2019 17:26:01 +0100 Subject: [PATCH] Test fix, wait for auto follower to have stopped in the background Relates to #36761 --- .../test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java index 1db42dba44e77..286e5badee133 100644 --- a/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java +++ b/x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/ccr/AutoFollowIT.java @@ -139,7 +139,13 @@ public void testAutoFollowManyIndices() throws Exception { assertThat(autoFollowStats.getNumberOfSuccessfulFollowIndices(), equalTo((long) expectedVal1)); }); + // Delete auto follow pattern and make sure that in the background the auto follower has stopped + // then the leader index created after that should never be auto followed: deleteAutoFollowPatternSetting(); + assertBusy(() -> { + AutoFollowStats autoFollowStats = getAutoFollowStats(); + assertThat(autoFollowStats.getAutoFollowedClusters().size(), equalTo(0)); + }); createLeaderIndex("logs-does-not-count", leaderIndexSettings); putAutoFollowPatterns("my-pattern", new String[] {"logs-*"});