fix flaky test

This commit is contained in:
mpostma 2021-02-01 18:59:22 +01:00
parent 1d910dbb42
commit 97f35de41f
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A

View File

@ -94,8 +94,16 @@ async fn return_update_status_of_pushed_documents() {
]; ];
let mut update_ids = Vec::new(); let mut update_ids = Vec::new();
let mut bodies = bodies.into_iter();
let url = "/indexes/test/documents?primaryKey=title"; let url = "/indexes/test/documents?primaryKey=title";
let (response, status_code) = server.post_request(&url, bodies.next().unwrap()).await;
assert_eq!(status_code, 202);
let update_id = response["updateId"].as_u64().unwrap();
update_ids.push(update_id);
server.wait_update_id(update_id).await;
let url = "/indexes/test/documents";
for body in bodies { for body in bodies {
let (response, status_code) = server.post_request(&url, body).await; let (response, status_code) = server.post_request(&url, body).await;
assert_eq!(status_code, 202); assert_eq!(status_code, 202);