re-enabled test with added logging to have more info when it fails.
This commit is contained in:
parent
ca916f7186
commit
38a1d4fcdb
|
@ -20,6 +20,7 @@
|
|||
package org.elasticsearch.client;
|
||||
|
||||
import org.apache.http.util.EntityUtils;
|
||||
import org.apache.logging.log4j.message.ParameterizedMessage;
|
||||
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest;
|
||||
import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse;
|
||||
import org.elasticsearch.action.admin.indices.close.CloseIndexRequest;
|
||||
|
@ -36,6 +37,7 @@ import org.elasticsearch.client.ccr.FollowStatsRequest;
|
|||
import org.elasticsearch.client.ccr.FollowStatsResponse;
|
||||
import org.elasticsearch.client.ccr.GetAutoFollowPatternRequest;
|
||||
import org.elasticsearch.client.ccr.GetAutoFollowPatternResponse;
|
||||
import org.elasticsearch.client.ccr.IndicesFollowStats;
|
||||
import org.elasticsearch.client.ccr.IndicesFollowStats.ShardFollowStats;
|
||||
import org.elasticsearch.client.ccr.PauseFollowRequest;
|
||||
import org.elasticsearch.client.ccr.PutAutoFollowPatternRequest;
|
||||
|
@ -85,7 +87,6 @@ public class CCRIT extends ESRestHighLevelClientTestCase {
|
|||
});
|
||||
}
|
||||
|
||||
@AwaitsFix(bugUrl="https://github.com/elastic/elasticsearch/issues/36339")
|
||||
public void testIndexFollowing() throws Exception {
|
||||
CcrClient ccrClient = highLevelClient().ccr();
|
||||
|
||||
|
@ -109,6 +110,7 @@ public class CCRIT extends ESRestHighLevelClientTestCase {
|
|||
SearchResponse leaderSearchResponse = highLevelClient().search(leaderSearchRequest, RequestOptions.DEFAULT);
|
||||
assertThat(leaderSearchResponse.getHits().getTotalHits().value, equalTo(1L));
|
||||
|
||||
try {
|
||||
assertBusy(() -> {
|
||||
FollowStatsRequest followStatsRequest = new FollowStatsRequest("follower");
|
||||
FollowStatsResponse followStatsResponse =
|
||||
|
@ -124,6 +126,17 @@ public class CCRIT extends ESRestHighLevelClientTestCase {
|
|||
SearchResponse followerSearchResponse = highLevelClient().search(followerSearchRequest, RequestOptions.DEFAULT);
|
||||
assertThat(followerSearchResponse.getHits().getTotalHits().value, equalTo(1L));
|
||||
});
|
||||
} catch (Exception e) {
|
||||
IndicesFollowStats followStats = ccrClient.getCcrStats(new CcrStatsRequest(), RequestOptions.DEFAULT).getIndicesFollowStats();
|
||||
for (Map.Entry<String, List<ShardFollowStats>> entry : followStats.getShardFollowStats().entrySet()) {
|
||||
for (ShardFollowStats shardFollowStats : entry.getValue()) {
|
||||
if (shardFollowStats.getFatalException() != null) {
|
||||
logger.warn(new ParameterizedMessage("fatal shard follow exception {}", shardFollowStats.getShardId()),
|
||||
shardFollowStats.getFatalException());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PauseFollowRequest pauseFollowRequest = new PauseFollowRequest("follower");
|
||||
AcknowledgedResponse pauseFollowResponse = execute(pauseFollowRequest, ccrClient::pauseFollow, ccrClient::pauseFollowAsync);
|
||||
|
|
Loading…
Reference in New Issue