Skip to content

Commit aa2db74

Browse files
authored
Add more logging around testStopQueryLocal to see what's going on (#124911)
1 parent d387af8 commit aa2db74

File tree

3 files changed

+19
-8
lines changed

3 files changed

+19
-8
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,6 @@ tests:
239239
- class: org.elasticsearch.xpack.esql.heap_attack.HeapAttackIT
240240
method: testEnrichExplosionManyMatches
241241
issue: https://github.com/elastic/elasticsearch/issues/122913
242-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
243-
method: testStopQueryLocal
244-
issue: https://github.com/elastic/elasticsearch/issues/121672
245242
- class: org.elasticsearch.xpack.ilm.actions.SearchableSnapshotActionIT
246243
method: testRestoredIndexManagedByLocalPolicySkipsIllegalActions
247244
issue: https://github.com/elastic/elasticsearch/issues/123202

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import org.elasticsearch.Build;
1111
import org.elasticsearch.action.ActionFuture;
1212
import org.elasticsearch.core.Tuple;
13+
import org.elasticsearch.logging.LogManager;
14+
import org.elasticsearch.logging.Logger;
1315
import org.elasticsearch.tasks.TaskInfo;
1416
import org.elasticsearch.xpack.core.async.AsyncStopRequest;
1517

@@ -34,6 +36,8 @@
3436

3537
public class CrossClusterAsyncQueryStopIT extends AbstractCrossClusterTestCase {
3638

39+
private static final Logger LOGGER = LogManager.getLogger(CrossClusterAsyncQueryStopIT.class);
40+
3741
public void testStopQuery() throws Exception {
3842
assumeTrue("Pragma does not work in release builds", Build.current().isSnapshot());
3943
Map<String, Object> testClusterInfo = setupClusters(3);
@@ -136,8 +140,8 @@ public void testStopQueryLocal() throws Exception {
136140
);
137141

138142
try {
139-
// wait until we know that the query against 'remote-b:blocking' has started
140-
SimplePauseFieldPlugin.startEmitting.await(30, TimeUnit.SECONDS);
143+
// wait until we know that the local query against 'blocking' has started
144+
assertTrue(SimplePauseFieldPlugin.startEmitting.await(30, TimeUnit.SECONDS));
141145

142146
// wait until the remotes are done
143147
waitForCluster(client(), REMOTE_CLUSTER_1, asyncExecutionId);
@@ -147,20 +151,22 @@ public void testStopQueryLocal() throws Exception {
147151
* the query against remotes should be finished
148152
* the query against the local cluster should be running because it's blocked
149153
*/
150-
151154
// run the stop query
152155
AsyncStopRequest stopRequest = new AsyncStopRequest(asyncExecutionId);
156+
LOGGER.info("Launching stop for {}", asyncExecutionId);
153157
ActionFuture<EsqlQueryResponse> stopAction = client().execute(EsqlAsyncStopAction.INSTANCE, stopRequest);
154158
// ensure stop operation is running
155159
assertBusy(() -> {
156160
try (EsqlQueryResponse asyncResponse = getAsyncResponse(client(), asyncExecutionId)) {
157161
EsqlExecutionInfo executionInfo = asyncResponse.getExecutionInfo();
162+
LOGGER.info("Waiting for stop operation to start, current status: {}", executionInfo);
158163
assertNotNull(executionInfo);
159164
assertThat(executionInfo.isStopped(), is(true));
160165
}
161166
});
162167
// allow local query to proceed
163168
SimplePauseFieldPlugin.allowEmitting.countDown();
169+
LOGGER.info("Collecting results for {}", asyncExecutionId);
164170

165171
// Since part of the query has not been stopped, we expect some result to emerge here
166172
try (EsqlQueryResponse asyncResponse = stopAction.actionGet(30, TimeUnit.SECONDS)) {
@@ -204,7 +210,6 @@ public void testStopQueryLocalNoRemotes() throws Exception {
204210
populateRuntimeIndex(LOCAL_CLUSTER, "pause", INDEX_WITH_BLOCKING_MAPPING);
205211

206212
Tuple<Boolean, Boolean> includeCCSMetadata = randomIncludeCCSMetadata();
207-
boolean responseExpectMeta = includeCCSMetadata.v2();
208213

209214
final String asyncExecutionId = startAsyncQuery(
210215
client(),

x-pack/plugin/esql/src/main/java/org/elasticsearch/xpack/esql/action/EsqlExecutionInfo.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,16 @@ public Stream<Cluster> getClusterStates(Cluster.Status status) {
317317

318318
@Override
319319
public String toString() {
320-
return "EsqlExecutionInfo{" + "overallTook=" + overallTook + ", clusterInfo=" + clusterInfo + '}';
320+
return "EsqlExecutionInfo{"
321+
+ "overallTook="
322+
+ overallTook
323+
+ ", isPartial="
324+
+ isPartial
325+
+ ", isStopped="
326+
+ isStopped
327+
+ ", clusterInfo="
328+
+ clusterInfo
329+
+ '}';
321330
}
322331

323332
@Override

0 commit comments

Comments
 (0)