Skip to content

Conversation

@bpintea
Copy link
Contributor

@bpintea bpintea commented Jun 11, 2025

This injects assertions in spec-based and YAML integration tests that the received results aren't partial.
This only happens in case the tests themselves don't set "allow_partial_results": true.

Closes #129256

This injects assertions in spec-based and YAML integration tests that
the received results aren't partial. This only happens in case the tests
themselves don't set `"allow_partial_results": true`
@bpintea bpintea added >test Issues or PRs that are addressing/adding tests :Analytics/ES|QL AKA ESQL v8.19.0 v9.1.0 labels Jun 11, 2025
Map<String, Object> answer = runEsql(builder.query(query), testCase.assertWarnings(deduplicateExactWarnings()));

var isPartial = answer.get("is_partial");
assertTrue("unexpected partial results", isPartial == null || (boolean) isPartial == false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be easier to read with assertThat(..., anyOf(is(false), nullValue())). Dunno. Your call.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, better, thanks.

var apiCallSection = doSection.getApiCallSection();
if (apiCallSection.getApi().equals("esql.query")) {
// If `allow_partial_results` is explicitly set to true, partial results are allowed.
// If it's missing, no partial results are expected, even if the parameter's default is true.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a bit of magic, I think it's a pretty reasonable sacrifice.

Copy link
Member

@dnhatn dnhatn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much, @bpintea. I wonder if we should also do this for other QA modules (multi-node, multi-nodes, mixed-cluster).


var isPartial = answer.get("is_partial");
assertTrue("unexpected partial results", isPartial == null || (boolean) isPartial == false);

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we also extract the failures and throw them?

Copy link
Contributor Author

@bpintea bpintea Jun 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, I've extracted _clusters contents into the assertion message (we don't have more otherwise).

@bpintea
Copy link
Contributor Author

bpintea commented Jun 17, 2025

I wonder if we should also do this for other QA modules (multi-node, multi-nodes, mixed-cluster).

The changes apply to those suites too.

@bpintea bpintea marked this pull request as ready for review June 17, 2025 14:08
@elasticsearchmachine elasticsearchmachine added the Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) label Jun 17, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-analytical-engine (Team:Analytics)

@bpintea bpintea added the auto-backport Automatically create backport pull requests when merged label Jun 17, 2025
@bpintea
Copy link
Contributor Author

bpintea commented Jun 17, 2025

Thanks Nik and Nhat.

@bpintea bpintea merged commit d51d643 into elastic:main Jun 17, 2025
26 of 27 checks passed
@bpintea bpintea deleted the test/assert_no_partial_results branch June 17, 2025 15:45
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
8.19 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 129293

elasticsearchmachine pushed a commit that referenced this pull request Jun 17, 2025
This injects assertions in spec-based and YAML integration tests that the received results aren't partial.
This only happens in case the tests themselves don't set "allow_partial_results": true.

Closes #129256

(cherry picked from commit d51d643)
elasticsearchmachine pushed a commit that referenced this pull request Jun 30, 2025
This extends the check that no partial results are returned to the rest
of the JSON-based REST ITs.

Related: #129293
bpintea added a commit to bpintea/elasticsearch that referenced this pull request Jun 30, 2025
…0213)

This extends the check that no partial results are returned to the rest
of the JSON-based REST ITs.

Related: elastic#129293
elasticsearchmachine pushed a commit that referenced this pull request Jun 30, 2025
…130332)

This extends the check that no partial results are returned to the rest
of the JSON-based REST ITs.

Related: #129293
elasticsearchmachine pushed a commit that referenced this pull request Jun 30, 2025
…130338)

This extends the check that no partial results are returned to the rest
of the JSON-based REST ITs.

Related: #129293
(cherry picked from commit 7836826)
mridula-s109 pushed a commit to mridula-s109/elasticsearch that referenced this pull request Jul 3, 2025
…0213)

This extends the check that no partial results are returned to the rest
of the JSON-based REST ITs.

Related: elastic#129293
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Analytics/ES|QL AKA ESQL auto-backport Automatically create backport pull requests when merged backport pending Team:Analytics Meta label for analytical engine team (ESQL/Aggs/Geo) >test Issues or PRs that are addressing/adding tests v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ESQL: Bugs don't show up in test failures, only in logs

4 participants