Skip to content

Commit 620c5a3

Browse files
authored
Stop reusing cluster for CrossClusterAsyncQueryStopIT and unmute (#136429)
* Stop reusing cluster & unmute
1 parent 31bfece commit 620c5a3

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,6 @@ tests:
411411
- class: org.elasticsearch.xpack.search.CrossClusterAsyncSearchIT
412412
method: testCancelViaExpirationOnRemoteResultsWithMinimizeRoundtrips
413413
issue: https://github.com/elastic/elasticsearch/issues/127302
414-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
415-
method: testStopQueryLocal
416-
issue: https://github.com/elastic/elasticsearch/issues/133481
417414
- class: org.elasticsearch.xpack.esql.inference.rerank.RerankOperatorTests
418415
method: testSimpleCircuitBreaking
419416
issue: https://github.com/elastic/elasticsearch/issues/133619

x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterAsyncQueryStopIT.java

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
package org.elasticsearch.xpack.esql.action;
99

1010
import org.elasticsearch.Build;
11+
import org.elasticsearch.ElasticsearchTimeoutException;
1112
import org.elasticsearch.action.ActionFuture;
1213
import org.elasticsearch.client.internal.Client;
1314
import org.elasticsearch.core.Tuple;
@@ -16,6 +17,8 @@
1617
import org.elasticsearch.tasks.TaskInfo;
1718
import org.elasticsearch.transport.TransportService;
1819
import org.elasticsearch.xpack.core.async.AsyncStopRequest;
20+
import org.elasticsearch.xpack.core.async.DeleteAsyncResultRequest;
21+
import org.elasticsearch.xpack.core.async.TransportDeleteAsyncResultAction;
1922
import org.elasticsearch.xpack.esql.plugin.EsqlPlugin;
2023
import org.elasticsearch.xpack.esql.plugin.QueryPragmas;
2124

@@ -28,7 +31,6 @@
2831

2932
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertAcked;
3033
import static org.elasticsearch.xpack.esql.action.AbstractEsqlIntegTestCase.randomIncludeCCSMetadata;
31-
import static org.elasticsearch.xpack.esql.action.EsqlAsyncTestUtils.deleteAsyncId;
3234
import static org.elasticsearch.xpack.esql.action.EsqlAsyncTestUtils.getAsyncResponse;
3335
import static org.elasticsearch.xpack.esql.action.EsqlAsyncTestUtils.startAsyncQuery;
3436
import static org.elasticsearch.xpack.esql.action.EsqlAsyncTestUtils.startAsyncQueryWithPragmas;
@@ -43,6 +45,11 @@ public class CrossClusterAsyncQueryStopIT extends AbstractCrossClusterTestCase {
4345

4446
private static final Logger LOGGER = LogManager.getLogger(CrossClusterAsyncQueryStopIT.class);
4547

48+
@Override
49+
protected boolean reuseClusters() {
50+
return false;
51+
}
52+
4653
public void testStopQuery() throws Exception {
4754
assumeTrue("Pragma does not work in release builds", Build.current().isSnapshot());
4855
Map<String, Object> testClusterInfo = setupClusters(3);
@@ -125,7 +132,7 @@ public void testStopQuery() throws Exception {
125132
} finally {
126133
// Ensure proper cleanup if the test fails
127134
CountingPauseFieldPlugin.allowEmitting.countDown();
128-
assertAcked(deleteAsyncId(client(), asyncExecutionId));
135+
deleteAsyncId(client(), asyncExecutionId);
129136
}
130137
}
131138

@@ -222,7 +229,7 @@ public void testStopQueryLocal() throws Exception {
222229
}
223230
} finally {
224231
SimplePauseFieldPlugin.allowEmitting.countDown();
225-
assertAcked(deleteAsyncId(client, asyncExecutionId));
232+
deleteAsyncId(client, asyncExecutionId);
226233
}
227234
}
228235

@@ -265,7 +272,7 @@ public void testStopQueryLocalNoRemotes() throws Exception {
265272
}
266273
} finally {
267274
SimplePauseFieldPlugin.allowEmitting.countDown();
268-
assertAcked(deleteAsyncId(client(), asyncExecutionId));
275+
deleteAsyncId(client(), asyncExecutionId);
269276
}
270277
}
271278

@@ -351,7 +358,16 @@ public void testStopQueryInlineStats() throws Exception {
351358
} finally {
352359
// Ensure proper cleanup if the test fails
353360
CountingPauseFieldPlugin.allowEmitting.countDown();
354-
assertAcked(deleteAsyncId(client(), asyncExecutionId));
361+
deleteAsyncId(client(), asyncExecutionId);
362+
}
363+
}
364+
365+
public void deleteAsyncId(Client client, String id) {
366+
try {
367+
DeleteAsyncResultRequest request = new DeleteAsyncResultRequest(id);
368+
assertAcked(client.execute(TransportDeleteAsyncResultAction.TYPE, request).actionGet(30, TimeUnit.SECONDS));
369+
} catch (ElasticsearchTimeoutException e) {
370+
LOGGER.warn("timeout waiting for DELETE response: {}: {}", id, e);
355371
}
356372
}
357373

0 commit comments

Comments
 (0)