Skip to content

Conversation

@benchaplin
Copy link
Contributor

Cleaning up this test suite. Its custom 1-second delay while-loop can be replaced with assertBusy, which is more consistent with other tests and implements exponential backoff under the hood, potentially speeding up the test runtime.

I also gave requests better names.

@benchaplin benchaplin added >non-issue Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch :Search Foundations/Search Catch all for Search Foundations labels Jul 15, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

Copy link
Member

@cbuescher cbuescher left a comment

Choose a reason for hiding this comment

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

thanks for the cleanup, LGTM. I left one question about whether the first conditionals in all of the changed tests are still necessary, just a possible small adjustment though, nothing that needs another review round.

createAsyncRequest.addParameter("keep_on_completion", "true");
createAsyncRequest.addParameter("wait_for_completion_timeout", "0ms");
Map<String, Object> createAsyncResponseEntity = performRequestAndGetResponseEntity(createAsyncRequest);
if (createAsyncResponseEntity.get("is_running").equals("true")) {
Copy link
Member

Choose a reason for hiding this comment

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

Is there a case where the the search might have already completed here? I guess that would be fine since we wouldn't need to wait any longer then, just wondering if that while conditional is needed any longer with the switch to busy waiting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't think the conditional is necessary, it's fine to always send the GET _async_search request. However I think it is possible that the search has already completed, so that check should speed up the test a bit.

@benchaplin benchaplin merged commit 0cf275e into elastic:main Jul 16, 2025
33 checks passed
szybia added a commit to szybia/elasticsearch that referenced this pull request Jul 22, 2025
…king

* upstream/main:
  Mark watcher NotMultiProjectCapable and replace deprecated multi-project methods (elastic#131313)
  Enable force inference endpoint deleting for invalid models and after stopping model deployment fails (elastic#129090)
  [ML] Remove SageMaker Elastic updates (elastic#131301)
  Refactor AsyncSearchErrorTraceIT to use assertBusy (elastic#131328)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

>non-issue :Search Foundations/Search Catch all for Search Foundations Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants