|
83 | 83 | import org.elasticsearch.xpack.core.XPackSettings; |
84 | 84 | import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata; |
85 | 85 | import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus; |
| 86 | +import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction; |
86 | 87 | import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction; |
87 | 88 | import org.elasticsearch.xpack.core.ccr.action.PauseFollowAction; |
88 | 89 | import org.elasticsearch.xpack.core.ccr.action.PutFollowAction; |
@@ -375,13 +376,18 @@ protected void ensureEmptyWriteBuffers() throws Exception { |
375 | 376 | protected void pauseFollow(String... indices) throws Exception { |
376 | 377 | for (String index : indices) { |
377 | 378 | final PauseFollowAction.Request unfollowRequest = new PauseFollowAction.Request(index); |
378 | | - followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).get(); |
| 379 | + assertAcked(followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).actionGet()); |
379 | 380 | } |
380 | 381 | ensureNoCcrTasks(); |
381 | 382 | } |
382 | 383 |
|
383 | 384 | protected void ensureNoCcrTasks() throws Exception { |
384 | 385 | assertBusy(() -> { |
| 386 | + CcrStatsAction.Response statsResponse = |
| 387 | + followerClient().execute(CcrStatsAction.INSTANCE, new CcrStatsAction.Request()).actionGet(); |
| 388 | + assertThat("Follow stats not empty: " + Strings.toString(statsResponse.getFollowStats()), |
| 389 | + statsResponse.getFollowStats().getStatsResponses(), empty()); |
| 390 | + |
385 | 391 | final ClusterState clusterState = followerClient().admin().cluster().prepareState().get().getState(); |
386 | 392 | final PersistentTasksCustomMetaData tasks = clusterState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE); |
387 | 393 | assertThat(tasks.tasks(), empty()); |
|
0 commit comments