From 4bcdd7a9f98f8ce7c49820666528188455e81fe4 Mon Sep 17 00:00:00 2001 From: Tamo Date: Wed, 18 Dec 2024 11:51:12 +0100 Subject: [PATCH] fix the flaky batches test --- crates/meilisearch/tests/batches/mod.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/meilisearch/tests/batches/mod.rs b/crates/meilisearch/tests/batches/mod.rs index 799aa3df7..a7980a507 100644 --- a/crates/meilisearch/tests/batches/mod.rs +++ b/crates/meilisearch/tests/batches/mod.rs @@ -167,18 +167,17 @@ async fn list_batches_status_filtered() { async fn list_batches_type_filtered() { let server = Server::new().await; let index = server.index("test"); - index.create(None).await; - index.wait_task(0).await; - index - .add_documents(serde_json::from_str(include_str!("../assets/test_set.json")).unwrap(), None) - .await; + let (task, _) = index.create(None).await; + index.wait_task(task.uid()).await.succeeded(); + let (task, _) = index.delete().await; + index.wait_task(task.uid()).await.succeeded(); let (response, code) = index.filtered_batches(&["indexCreation"], &[], &[]).await; assert_eq!(code, 200, "{}", response); assert_eq!(response["results"].as_array().unwrap().len(), 1); let (response, code) = - index.filtered_batches(&["indexCreation", "documentAdditionOrUpdate"], &[], &[]).await; + index.filtered_batches(&["indexCreation", "indexDeletion"], &[], &[]).await; assert_eq!(code, 200, "{}", response); assert_eq!(response["results"].as_array().unwrap().len(), 2); }