Skip to content

Commit d9f84ec

Browse files
authored
Fix testStopQueryInlineStats - allow wider range of values (#135812) (#135955)
(cherry picked from commit e63add2)
1 parent e641d40 commit d9f84ec

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

muted-tests.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -507,9 +507,6 @@ tests:
507507
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.MinioRepositoryAnalysisRestIT
508508
method: testRepositoryAnalysis
509509
issue: https://github.com/elastic/elasticsearch/issues/134853
510-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
511-
method: testStopQueryInlinestats
512-
issue: https://github.com/elastic/elasticsearch/issues/134854
513510
- class: org.elasticsearch.xpack.esql.action.CrossClusterCancellationIT
514511
method: testCancelSkipUnavailable
515512
issue: https://github.com/elastic/elasticsearch/issues/134865
@@ -525,9 +522,6 @@ tests:
525522
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
526523
method: test {csv-spec:stats.CountDistinctWithConditions}
527524
issue: https://github.com/elastic/elasticsearch/issues/134993
528-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
529-
method: testStopQueryInlineStats
530-
issue: https://github.com/elastic/elasticsearch/issues/135032
531525
- class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT
532526
method: test {csv-spec:fork.ForkBeforeStatsWithWhere}
533527
issue: https://github.com/elastic/elasticsearch/issues/135041

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,9 +314,13 @@ public void testStopQueryInlineStats() throws Exception {
314314
assertThat(asyncResponse.columns().size(), equalTo(2));
315315
AtomicInteger i = new AtomicInteger(0);
316316
asyncResponse.values().forEachRemaining(row -> {
317-
// We will have all rows here but total will be null since we stopped the inline stats before it could complete
318-
assertThat(row.next(), equalTo(null));
319317
var v = row.next();
318+
// The sum could be null, if the stats did not manage to compute anything before being stopped
319+
// Or it could be 45L if it managed to add 0-9
320+
if (v != null) {
321+
assertThat((long) v, equalTo(45L));
322+
}
323+
v = row.next();
320324
if (v != null) {
321325
assertThat((long) v, lessThanOrEqualTo(10L));
322326
}

0 commit comments

Comments
 (0)