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