Skip to content

Commit 61c368c

Browse files
committed
HLREST: AwaitsFix ML Test
It leaks state into other tests causing them to fail sometimes. Relates to #32993
1 parent 724ee0c commit 61c368c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

client/rest-high-level/src/test/java/org/elasticsearch/client/ClusterClientIT.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package org.elasticsearch.client;
2121

22+
import org.apache.http.util.EntityUtils;
2223
import org.elasticsearch.ElasticsearchException;
2324
import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
2425
import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
@@ -34,6 +35,7 @@
3435
import org.elasticsearch.common.unit.ByteSizeUnit;
3536
import org.elasticsearch.common.xcontent.XContentType;
3637
import org.elasticsearch.common.xcontent.support.XContentMapValues;
38+
import org.elasticsearch.client.Request;
3739
import org.elasticsearch.indices.recovery.RecoverySettings;
3840
import org.elasticsearch.rest.RestStatus;
3941

@@ -178,6 +180,8 @@ public void testClusterHealthYellowClusterLevel() throws IOException {
178180
request.level(ClusterHealthRequest.Level.CLUSTER);
179181
ClusterHealthResponse response = execute(request, highLevelClient().cluster()::health, highLevelClient().cluster()::healthAsync);
180182

183+
logger.info("Shard stats\n{}", EntityUtils.toString(
184+
client().performRequest(new Request("GET", "/_cat/shards")).getEntity()));
181185
assertYellowShards(response);
182186
assertThat(response.getIndices().size(), equalTo(0));
183187
}
@@ -190,6 +194,8 @@ public void testClusterHealthYellowIndicesLevel() throws IOException {
190194
request.level(ClusterHealthRequest.Level.INDICES);
191195
ClusterHealthResponse response = execute(request, highLevelClient().cluster()::health, highLevelClient().cluster()::healthAsync);
192196

197+
logger.info("Shard stats\n{}", EntityUtils.toString(
198+
client().performRequest(new Request("GET", "/_cat/shards")).getEntity()));
193199
assertYellowShards(response);
194200
assertThat(response.getIndices().size(), equalTo(2));
195201
for (Map.Entry<String, ClusterIndexHealth> entry : response.getIndices().entrySet()) {

client/rest-high-level/src/test/java/org/elasticsearch/client/MachineLearningIT.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package org.elasticsearch.client;
2020

2121
import com.carrotsearch.randomizedtesting.generators.CodepointSetGenerator;
22+
import org.apache.lucene.util.LuceneTestCase.AwaitsFix;
2223
import org.elasticsearch.common.unit.TimeValue;
2324
import org.elasticsearch.protocol.xpack.ml.DeleteJobRequest;
2425
import org.elasticsearch.protocol.xpack.ml.DeleteJobResponse;
@@ -36,6 +37,7 @@
3637

3738
import static org.hamcrest.Matchers.is;
3839

40+
@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/32993")
3941
public class MachineLearningIT extends ESRestHighLevelClientTestCase {
4042

4143
public void testPutJob() throws Exception {

0 commit comments

Comments
 (0)