5182: Remove hard coded task ids to prevent flaky tests r=irevoire a=mhmoudr

# Pull Request

## Related issue
Fixes partial #4840

## What does this PR do?
- Mainly scan the test code for any hard coded task Id and replace it by the returned task Id once the action or task is performed on an index.
- PS: _PR is not split by files as it has one theme applied to all tests which make it easy to review_ 


## PR checklist
Please check if your PR fulfills the following requirements:
- [x] Does this PR fix an existing issue, or have you listed the changes applied in the PR description (and why they are needed)?
- [x] Have you read the contributing guidelines?
- [x] Have you made sure that the title is accurate and descriptive of the changes?

Thank you so much for contributing to Meilisearch!


Co-authored-by: Mahmoud Rawas <mhmoudr@gmail.com>
Co-authored-by: Tamo <tamo@meilisearch.com>
This commit is contained in:
meili-bors[bot] 2025-01-13 15:18:55 +00:00 committed by GitHub
commit e568dbbabb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 733 additions and 727 deletions

View file

@ -7,11 +7,11 @@ use crate::common::Server;
async fn create_and_get_index() {
let server = Server::new().await;
let index = server.index("test");
let (_, code) = index.create(None).await;
let (task, code) = index.create(None).await;
assert_eq!(code, 202);
index.wait_task(0).await;
index.wait_task(task.uid()).await.succeeded();
let (response, code) = index.get().await;
@ -55,9 +55,9 @@ async fn no_index_return_empty_list() {
async fn list_multiple_indexes() {
let server = Server::new().await;
server.index("test").create(None).await;
server.index("test1").create(Some("key")).await;
let (task, _status_code) = server.index("test1").create(Some("key")).await;
server.index("test").wait_task(1).await;
server.index("test").wait_task(task.uid()).await.succeeded();
let (response, code) = server.list_indexes(None, None).await;
assert_eq!(code, 200);