diff --git a/meilisearch/tests/tasks/mod.rs b/meilisearch/tests/tasks/mod.rs index 6124de4b7..a9ed5c00f 100644 --- a/meilisearch/tests/tasks/mod.rs +++ b/meilisearch/tests/tasks/mod.rs @@ -1026,10 +1026,16 @@ async fn test_task_queue_is_full() { "###); loop { - let (res, _code) = server.create_index(json!({ "uid": "doggo" })).await; - if res["taskUid"] == json!(null) { + let (res, code) = server.create_index(json!({ "uid": "doggo" })).await; + if code == 422 { break; } + if res["taskUid"] == json!(null) { + panic!( + "Encountered the strange case:\n{}", + serde_json::to_string_pretty(&res).unwrap() + ); + } } let (result, code) = server.create_index(json!({ "uid": "doggo" })).await; @@ -1058,10 +1064,16 @@ async fn test_task_queue_is_full() { // we're going to fill up the queue once again loop { - let (res, _code) = server.create_index(json!({ "uid": "doggo" })).await; - if res["taskUid"] == json!(null) { + let (res, code) = server.create_index(json!({ "uid": "doggo" })).await; + if code == 422 { break; } + if res["taskUid"] == json!(null) { + panic!( + "Encountered the strange case:\n{}", + serde_json::to_string_pretty(&res).unwrap() + ); + } } // But we should NOT be able to register this task because it doesn't match any tasks