Skip to content

Commit 31163f0

Browse files
committed
also check ccr stats api return empty response in ensureNoCcrTasks()
If this fails then it returns more detailed information, for example fatal error.
1 parent b6a7e99 commit 31163f0

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

x-pack/plugin/ccr/src/test/java/org/elasticsearch/xpack/CcrIntegTestCase.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
import org.elasticsearch.xpack.core.XPackSettings;
8484
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata;
8585
import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus;
86+
import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction;
8687
import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction;
8788
import org.elasticsearch.xpack.core.ccr.action.PauseFollowAction;
8889
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
@@ -375,13 +376,18 @@ protected void ensureEmptyWriteBuffers() throws Exception {
375376
protected void pauseFollow(String... indices) throws Exception {
376377
for (String index : indices) {
377378
final PauseFollowAction.Request unfollowRequest = new PauseFollowAction.Request(index);
378-
followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).get();
379+
assertAcked(followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).actionGet());
379380
}
380381
ensureNoCcrTasks();
381382
}
382383

383384
protected void ensureNoCcrTasks() throws Exception {
384385
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+
385391
final ClusterState clusterState = followerClient().admin().cluster().prepareState().get().getState();
386392
final PersistentTasksCustomMetaData tasks = clusterState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
387393
assertThat(tasks.tasks(), empty());

0 commit comments

Comments
 (0)