Skip to content

Conversation

@javanna
Copy link
Member

@javanna javanna commented Feb 10, 2025

Backports the following commits to 9.0:

@javanna javanna added :Search Foundations/Search Catch all for Search Foundations >test Issues or PRs that are addressing/adding tests auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch labels Feb 10, 2025
Two of the timeout tests have been muted for several months. The reason is that we tightened the assertions to cover for partial results being returned, but there were edge cases in which partial results were not actually returned.

The timeout used in the test was time dependent, hence when the timeout precisely will be thrown is unpredictable, because we have timeout checks in different places in the codebase, when iterating through the leaves, before scoring any document, or while scoring documents. The edge case that caused failures is a typical timing issue where the initial check for timeout in CancellableBulkScorer already triggers the timeout, before any document has been collected.

I made several adjustments to the test to make it more robust:
- use index random to index documents, that speeds it up
- share indexing across test methods, so that it happens once at the suite level
- replace the custom query that triggers a timeout to not be a script query, but rather a lucene query that is not time dependent, and throws a time exceeded exception precisely where we expect it, so that we can test how the system reacts to that. That allows to test that partial results are always returned when a timeout happens while scoring documents, and that partial results are never returned when a timeout happens before we even started to score documents. 

Closes elastic#98369
Closes elastic#98053
@javanna javanna force-pushed the backport/9.0/pr-120390 branch from b219f51 to 8f27699 Compare February 10, 2025 18:38
@elasticsearchmachine elasticsearchmachine merged commit f078c38 into elastic:9.0 Feb 10, 2025
16 checks passed
@javanna javanna deleted the backport/9.0/pr-120390 branch February 10, 2025 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) backport :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch >test Issues or PRs that are addressing/adding tests v9.0.1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants