mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 14:54:27 +01:00
Await the last insert task
This commit is contained in:
parent
8bc602a7dd
commit
7e355958e0
@ -272,7 +272,8 @@ async fn access_authorized_stats_restricted_index() {
|
|||||||
let index = server.index("products");
|
let index = server.index("products");
|
||||||
let (response, code) = index.create(Some("product_id")).await;
|
let (response, code) = index.create(Some("product_id")).await;
|
||||||
assert_eq!(202, code, "{:?}", &response);
|
assert_eq!(202, code, "{:?}", &response);
|
||||||
index.wait_task(0).await;
|
let task_id = response["taskUid"].as_u64().unwrap();
|
||||||
|
index.wait_task(task_id).await;
|
||||||
|
|
||||||
// create key with access on `products` index only.
|
// create key with access on `products` index only.
|
||||||
let content = json!({
|
let content = json!({
|
||||||
@ -312,7 +313,8 @@ async fn access_authorized_stats_no_index_restriction() {
|
|||||||
let index = server.index("products");
|
let index = server.index("products");
|
||||||
let (response, code) = index.create(Some("product_id")).await;
|
let (response, code) = index.create(Some("product_id")).await;
|
||||||
assert_eq!(202, code, "{:?}", &response);
|
assert_eq!(202, code, "{:?}", &response);
|
||||||
index.wait_task(0).await;
|
let task_id = response["taskUid"].as_u64().unwrap();
|
||||||
|
index.wait_task(task_id).await;
|
||||||
|
|
||||||
// create key with access on all indexes.
|
// create key with access on all indexes.
|
||||||
let content = json!({
|
let content = json!({
|
||||||
@ -352,7 +354,8 @@ async fn list_authorized_indexes_restricted_index() {
|
|||||||
let index = server.index("products");
|
let index = server.index("products");
|
||||||
let (response, code) = index.create(Some("product_id")).await;
|
let (response, code) = index.create(Some("product_id")).await;
|
||||||
assert_eq!(202, code, "{:?}", &response);
|
assert_eq!(202, code, "{:?}", &response);
|
||||||
index.wait_task(0).await;
|
let task_id = response["taskUid"].as_u64().unwrap();
|
||||||
|
index.wait_task(task_id).await;
|
||||||
|
|
||||||
// create key with access on `products` index only.
|
// create key with access on `products` index only.
|
||||||
let content = json!({
|
let content = json!({
|
||||||
@ -393,7 +396,8 @@ async fn list_authorized_indexes_no_index_restriction() {
|
|||||||
let index = server.index("products");
|
let index = server.index("products");
|
||||||
let (response, code) = index.create(Some("product_id")).await;
|
let (response, code) = index.create(Some("product_id")).await;
|
||||||
assert_eq!(202, code, "{:?}", &response);
|
assert_eq!(202, code, "{:?}", &response);
|
||||||
index.wait_task(0).await;
|
let task_id = response["taskUid"].as_u64().unwrap();
|
||||||
|
index.wait_task(task_id).await;
|
||||||
|
|
||||||
// create key with access on all indexes.
|
// create key with access on all indexes.
|
||||||
let content = json!({
|
let content = json!({
|
||||||
@ -433,7 +437,8 @@ async fn list_authorized_tasks_restricted_index() {
|
|||||||
let index = server.index("products");
|
let index = server.index("products");
|
||||||
let (response, code) = index.create(Some("product_id")).await;
|
let (response, code) = index.create(Some("product_id")).await;
|
||||||
assert_eq!(202, code, "{:?}", &response);
|
assert_eq!(202, code, "{:?}", &response);
|
||||||
index.wait_task(0).await;
|
let task_id = response["taskUid"].as_u64().unwrap();
|
||||||
|
index.wait_task(task_id).await;
|
||||||
|
|
||||||
// create key with access on `products` index only.
|
// create key with access on `products` index only.
|
||||||
let content = json!({
|
let content = json!({
|
||||||
@ -473,7 +478,8 @@ async fn list_authorized_tasks_no_index_restriction() {
|
|||||||
let index = server.index("products");
|
let index = server.index("products");
|
||||||
let (response, code) = index.create(Some("product_id")).await;
|
let (response, code) = index.create(Some("product_id")).await;
|
||||||
assert_eq!(202, code, "{:?}", &response);
|
assert_eq!(202, code, "{:?}", &response);
|
||||||
index.wait_task(0).await;
|
let task_id = response["taskUid"].as_u64().unwrap();
|
||||||
|
index.wait_task(task_id).await;
|
||||||
|
|
||||||
// create key with access on all indexes.
|
// create key with access on all indexes.
|
||||||
let content = json!({
|
let content = json!({
|
||||||
|
Loading…
Reference in New Issue
Block a user