From e9d476b0e2a2fd907d61769a98fb9f41487aa153 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Wed, 1 Oct 2025 15:34:16 -0600 Subject: [PATCH] Fix testStopQueryInlineStats - allow wider range of values --- muted-tests.yml | 6 ------ .../xpack/esql/action/CrossClusterAsyncQueryStopIT.java | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/muted-tests.yml b/muted-tests.yml index cb564751b7412..f06e36f56ba35 100644 --- a/muted-tests.yml +++ b/muted-tests.yml @@ -510,9 +510,6 @@ tests: - class: org.elasticsearch.repositories.blobstore.testkit.analyze.MinioRepositoryAnalysisRestIT method: testRepositoryAnalysis issue: https://github.com/elastic/elasticsearch/issues/134853 -- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT - method: testStopQueryInlinestats - issue: https://github.com/elastic/elasticsearch/issues/134854 - class: org.elasticsearch.xpack.esql.action.CrossClusterCancellationIT method: testCancelSkipUnavailable issue: https://github.com/elastic/elasticsearch/issues/134865 @@ -528,9 +525,6 @@ tests: - class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT method: test {csv-spec:stats.CountDistinctWithConditions} issue: https://github.com/elastic/elasticsearch/issues/134993 -- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT - method: testStopQueryInlineStats - issue: https://github.com/elastic/elasticsearch/issues/135032 - class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT method: test {csv-spec:fork.ForkBeforeStatsWithWhere} issue: https://github.com/elastic/elasticsearch/issues/135041 diff --git a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterAsyncQueryStopIT.java b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterAsyncQueryStopIT.java index ab4079e12b969..972a9a4653671 100644 --- a/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterAsyncQueryStopIT.java +++ b/x-pack/plugin/esql/src/internalClusterTest/java/org/elasticsearch/xpack/esql/action/CrossClusterAsyncQueryStopIT.java @@ -314,9 +314,13 @@ public void testStopQueryInlineStats() throws Exception { assertThat(asyncResponse.columns().size(), equalTo(2)); AtomicInteger i = new AtomicInteger(0); asyncResponse.values().forEachRemaining(row -> { - // We will have all rows here but total will be null since we stopped the inline stats before it could complete - assertThat(row.next(), equalTo(null)); var v = row.next(); + // The sum could be null, if the stats did not manage to compute anything before being stopped + // Or it could be 45L if it managed to add 0-9 + if (v != null) { + assertThat((long) v, equalTo(45L)); + } + v = row.next(); if (v != null) { assertThat((long) v, lessThanOrEqualTo(10L)); }