Skip to content

Commit f86e8eb

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 34b3665 commit f86e8eb

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
@@ -82,6 +82,7 @@
8282
import org.elasticsearch.xpack.core.XPackSettings;
8383
import org.elasticsearch.xpack.core.ccr.AutoFollowMetadata;
8484
import org.elasticsearch.xpack.core.ccr.ShardFollowNodeTaskStatus;
85+
import org.elasticsearch.xpack.core.ccr.action.CcrStatsAction;
8586
import org.elasticsearch.xpack.core.ccr.action.FollowStatsAction;
8687
import org.elasticsearch.xpack.core.ccr.action.PauseFollowAction;
8788
import org.elasticsearch.xpack.core.ccr.action.PutFollowAction;
@@ -380,13 +381,18 @@ protected void ensureEmptyWriteBuffers() throws Exception {
380381
protected void pauseFollow(String... indices) throws Exception {
381382
for (String index : indices) {
382383
final PauseFollowAction.Request unfollowRequest = new PauseFollowAction.Request(index);
383-
followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).get();
384+
assertAcked(followerClient().execute(PauseFollowAction.INSTANCE, unfollowRequest).actionGet());
384385
}
385386
ensureNoCcrTasks();
386387
}
387388

388389
protected void ensureNoCcrTasks() throws Exception {
389390
assertBusy(() -> {
391+
CcrStatsAction.Response statsResponse =
392+
followerClient().execute(CcrStatsAction.INSTANCE, new CcrStatsAction.Request()).actionGet();
393+
assertThat("Follow stats not empty: " + Strings.toString(statsResponse.getFollowStats()),
394+
statsResponse.getFollowStats().getStatsResponses(), empty());
395+
390396
final ClusterState clusterState = followerClient().admin().cluster().prepareState().get().getState();
391397
final PersistentTasksCustomMetaData tasks = clusterState.getMetaData().custom(PersistentTasksCustomMetaData.TYPE);
392398
assertThat(tasks.tasks(), empty());

0 commit comments

Comments
 (0)