Merge pull request #5488 from meilisearch/try-batch-end-reason

add "batcher stopped because" field to batch objects
This commit is contained in:
Tamo 2025-04-17 08:26:31 +00:00 committed by GitHub
commit e9b4794f2b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
145 changed files with 1143 additions and 889 deletions

View file

@ -309,7 +309,8 @@ async fn test_summarized_document_addition_or_update() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"###);
@ -351,7 +352,8 @@ async fn test_summarized_document_addition_or_update() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"###);
}
@ -395,7 +397,8 @@ async fn test_summarized_delete_documents_by_batch() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"###);
@ -436,7 +439,8 @@ async fn test_summarized_delete_documents_by_batch() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"###);
}
@ -483,7 +487,8 @@ async fn test_summarized_delete_documents_by_filter() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"###);
@ -526,7 +531,8 @@ async fn test_summarized_delete_documents_by_filter() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"###);
@ -545,7 +551,7 @@ async fn test_summarized_delete_documents_by_filter() {
".stats.writeChannelCongestion" => "[writeChannelCongestion]",
".stats.internalDatabaseSizes" => "[internalDatabaseSizes]"
},
@r#"
@r###"
{
"uid": 4,
"progress": null,
@ -569,9 +575,10 @@ async fn test_summarized_delete_documents_by_filter() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"#);
"###);
}
#[actix_web::test]
@ -591,7 +598,7 @@ async fn test_summarized_delete_document_by_id() {
".stats.progressTrace" => "[progressTrace]",
".stats.writeChannelCongestion" => "[writeChannelCongestion]"
},
@r#"
@r###"
{
"uid": "[uid]",
"progress": null,
@ -614,9 +621,10 @@ async fn test_summarized_delete_document_by_id() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"#);
"###);
index.create(None).await;
let (task, _status_code) = index.delete_document(42).await;
@ -632,7 +640,7 @@ async fn test_summarized_delete_document_by_id() {
".stats.writeChannelCongestion" => "[writeChannelCongestion]",
".stats.internalDatabaseSizes" => "[internalDatabaseSizes]"
},
@r#"
@r###"
{
"uid": 2,
"progress": null,
@ -655,9 +663,10 @@ async fn test_summarized_delete_document_by_id() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"#);
"###);
}
#[actix_web::test]
@ -721,7 +730,8 @@ async fn test_summarized_settings_update() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "batched all enqueued tasks"
}
"###);
}
@ -762,7 +772,8 @@ async fn test_summarized_index_creation() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 0 of type `indexCreation` cannot be batched"
}
"###);
@ -800,7 +811,8 @@ async fn test_summarized_index_creation() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 1 of type `indexCreation` cannot be batched"
}
"###);
}
@ -951,7 +963,8 @@ async fn test_summarized_index_update() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 0 of type `indexUpdate` cannot be batched"
}
"###);
@ -989,7 +1002,8 @@ async fn test_summarized_index_update() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 1 of type `indexUpdate` cannot be batched"
}
"###);
@ -1008,7 +1022,7 @@ async fn test_summarized_index_update() {
".stats.progressTrace" => "[progressTrace]",
".stats.writeChannelCongestion" => "[writeChannelCongestion]"
},
@r#"
@r###"
{
"uid": 3,
"progress": null,
@ -1028,9 +1042,10 @@ async fn test_summarized_index_update() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 3 of type `indexUpdate` cannot be batched"
}
"#);
"###);
let (task, _status_code) = index.update(Some("bones")).await;
index.wait_task(task.uid()).await.succeeded();
@ -1066,7 +1081,8 @@ async fn test_summarized_index_update() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 4 of type `indexUpdate` cannot be batched"
}
"###);
}
@ -1117,7 +1133,8 @@ async fn test_summarized_index_swap() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 0 of type `indexSwap` cannot be batched"
}
"###);
@ -1159,7 +1176,8 @@ async fn test_summarized_index_swap() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 1 of type `indexCreation` cannot be batched"
}
"###);
}
@ -1205,7 +1223,8 @@ async fn test_summarized_batch_cancelation() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 1 of type `taskCancelation` cannot be batched"
}
"###);
}
@ -1251,7 +1270,8 @@ async fn test_summarized_batch_deletion() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "a batch of tasks of type `taskDeletion` cannot be batched with any other type of task"
}
"###);
}
@ -1292,7 +1312,8 @@ async fn test_summarized_dump_creation() {
},
"duration": "[duration]",
"startedAt": "[date]",
"finishedAt": "[date]"
"finishedAt": "[date]",
"batcherStoppedBecause": "task with id 0 of type `dumpCreation` cannot be batched"
}
"###);
}