Skip to content

Commit ce41290

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 ab4d5f4 commit ce41290

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
@@ -84,6 +84,7 @@
8484
import org.elasticsearch.xpack.core.XPackSettings;
8585
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata;
8686
import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus;
87+
import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction;
8788
import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction;
8889
import org.elasticsearch.xpack.core.ccr.action.PauseFollowAction;
8990
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
@@ -376,13 +377,18 @@ protected void ensureEmptyWriteBuffers() throws Exception {
376377
protected void pauseFollow(String... indices) throws Exception {
377378
for (String index : indices) {
378379
final PauseFollowAction.Request unfollowRequest = new PauseFollowAction.Request(index);
379-
followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).get();
380+
assertAcked(followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).actionGet());
380381
}
381382
ensureNoCcrTasks();
382383
}
383384

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

0 commit comments

Comments
 (0)