Skip to content

Commit e63add2

Browse files
authored
Fix testStopQueryInlineStats - allow wider range of values (#135812)
1 parent 72f2bcb commit e63add2

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
@@ -504,9 +504,6 @@ tests:
504504
- class: org.elasticsearch.repositories.blobstore.testkit.analyze.MinioRepositoryAnalysisRestIT
505505
method: testRepositoryAnalysis
506506
issue: https://github.com/elastic/elasticsearch/issues/134853
507-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
508-
method: testStopQueryInlinestats
509-
issue: https://github.com/elastic/elasticsearch/issues/134854
510507
- class: org.elasticsearch.xpack.esql.action.CrossClusterCancellationIT
511508
method: testCancelSkipUnavailable
512509
issue: https://github.com/elastic/elasticsearch/issues/134865
@@ -522,9 +519,6 @@ tests:
522519
- class: org.elasticsearch.xpack.esql.qa.mixed.MixedClusterEsqlSpecIT
523520
method: test {csv-spec:stats.CountDistinctWithConditions}
524521
issue: https://github.com/elastic/elasticsearch/issues/134993
525-
- class: org.elasticsearch.xpack.esql.action.CrossClusterAsyncQueryStopIT
526-
method: testStopQueryInlineStats
527-
issue: https://github.com/elastic/elasticsearch/issues/135032
528522
- class: org.elasticsearch.xpack.esql.ccq.MultiClusterSpecIT
529523
method: test {csv-spec:fork.ForkBeforeStatsWithWhere}
530524
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)