Skip to content

Commit 2a591a6

Browse files
authored
Add more logging around testStopQueryLocal to see what's going on (elastic#124911) (elastic#124932)
(cherry picked from commit aa2db74) # Conflicts: # muted-tests.yml
1 parent 1518975 commit 2a591a6

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
@@ -426,9 +426,6 @@ tests:
426426
- class: org.elasticsearch.ingest.geoip.GeoIpDownloaderCliIT
427427
method: testGeoIpDatabasesDownloadNoGeoipProcessors
428428
issue: https://github.com/elastic/elasticsearch/issues/122683
429-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
430-
method: testStopQueryLocal
431-
issue: https://github.com/elastic/elasticsearch/issues/121672
432429
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
433430
method: test {p0=snapshot/10_basic/Create a source only snapshot and then restore it}
434431
issue: https://github.com/elastic/elasticsearch/issues/122755

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
@@ -302,7 +302,16 @@ public int getClusterStateCount(Cluster.Status status) {
302302

303303
@Override
304304
public String toString() {
305-
return "EsqlExecutionInfo{" + "overallTook=" + overallTook + ", clusterInfo=" + clusterInfo + '}';
305+
return "EsqlExecutionInfo{"
306+
+ "overallTook="
307+
+ overallTook
308+
+ ", isPartial="
309+
+ isPartial
310+
+ ", isStopped="
311+
+ isStopped
312+
+ ", clusterInfo="
313+
+ clusterInfo
314+
+ '}';
306315
}
307316

308317
@Override

0 commit comments

Comments
 (0)