improve the test and try to understand the issue happening on windows

This commit is contained in:
Tamo 2023-04-11 16:30:56 +02:00
parent be69ab320d
commit 9350a7b017
No known key found for this signature in database
GPG Key ID: 20CD8020AFA88D69
1 changed files with 16 additions and 4 deletions

View File

@ -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