From bbb681361cac1792f19b6afd751432aea556fc29 Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Wed, 12 Mar 2025 10:28:07 +0100 Subject: [PATCH] Prefer waiting for the task before getting the indexes --- crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs b/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs index 3e9f2b932..11ba2882a 100644 --- a/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs +++ b/crates/meilisearch/tests/upgrade/v1_12/v1_12_0.rs @@ -108,6 +108,10 @@ async fn check_the_keys(server: &Server) { /// 5.2. Enqueue a new task /// 5.3. Create an index async fn check_the_index_scheduler(server: &Server) { + // Wait until the upgrade has been applied to all indexes to avoid flakyness + let (tasks, _) = server.tasks_filter("types=upgradeDatabase&limit=1").await; + server.wait_task(Value(tasks["results"][0].clone()).uid()).await.succeeded(); + // All the indexes are still present let (indexes, _) = server.list_indexes(None, None).await; snapshot!(indexes, @r#" @@ -156,10 +160,6 @@ async fn check_the_index_scheduler(server: &Server) { } "###); - // Wait until the upgrade has been applied to all indexes to avoid flakyness - let (tasks, _) = server.tasks_filter("types=upgradeDatabase&limit=1").await; - server.wait_task(Value(tasks["results"][0].clone()).uid()).await.succeeded(); - // Tasks and batches should still work // We rewrite the first task for all calls because it may be the upgrade database with unknown dates and duration. // The other tasks should NOT change