elastic / elasticsearch

Free and Open Source, Distributed, RESTful Search Engine
https://www.elastic.co/products/elasticsearch
Other
1.37k stars 24.87k forks source link

Docs tests should ensure pending async queries are removed at the end of the test #117376

Open smalyshev opened 2 days ago

smalyshev commented 2 days ago

Following up the discussion on https://github.com/elastic/elasticsearch/pull/117301

Right now some tests, especially docs tests, may launch async queries, that may due to the server load take significantly longer than intended. This query may linger post cleanup and thus potentially influence next tests or leave cluster in unclean state (e.g. by re-creating .async-search index).

Ideally, we should have some code in the "after" sections of those tests that along with all the rest of cleanups also cleans up all the async queries. It is complicated by the fact that right now we have several async APIs, for various searches and languages (e.g. _search, ES|QL, etc.) and most of them have neither "list all" not "delete all" operation as it appears.

smalyshev commented 2 days ago

Maybe using cleanUpFeature from Plugin API would be helpful here?