test task db full now checks that a task can be successfully added after deleting tasks

This commit is contained in:
Louis Dureuil 2023-04-13 17:20:06 +02:00
parent fd583501d7
commit 066c6bd875
No known key found for this signature in database

View File

@ -1050,7 +1050,7 @@ async fn test_task_queue_is_full() {
"###); "###);
// But we should still be able to register tasks deletion IF they delete something // But we should still be able to register tasks deletion IF they delete something
let (result, code) = server.delete_tasks("uids=0").await; let (result, code) = server.delete_tasks("uids=*").await;
snapshot!(code, @"200 OK"); snapshot!(code, @"200 OK");
snapshot!(json_string!(result, { ".enqueuedAt" => "[date]", ".taskUid" => "uid" }), @r###" snapshot!(json_string!(result, { ".enqueuedAt" => "[date]", ".taskUid" => "uid" }), @r###"
{ {
@ -1062,6 +1062,19 @@ async fn test_task_queue_is_full() {
} }
"###); "###);
// But we should still be able to register tasks deletion IF they delete something
let (result, code) = server.create_index(json!({ "uid": "doggo" })).await;
snapshot!(code, @"202 Accepted");
snapshot!(json_string!(result, { ".enqueuedAt" => "[date]", ".taskUid" => "uid" }), @r###"
{
"taskUid": "uid",
"indexUid": "doggo",
"status": "enqueued",
"type": "indexCreation",
"enqueuedAt": "[date]"
}
"###);
// we're going to fill up the queue once again // we're going to fill up the queue once again
loop { loop {
let (res, code) = server.delete_tasks("uids=0").await; let (res, code) = server.delete_tasks("uids=0").await;