Fix a few index swap bugs.

1. Details of the indexSwap task
2. Query tasks with type=indexUid
3. Synchronous error message for multiple index not found
This commit is contained in:
Loïc Lecrenier 2022-10-26 12:57:29 +02:00 committed by Clément Renault
parent a16604af80
commit 1f75caae88
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
13 changed files with 75 additions and 35 deletions

View file

@ -971,6 +971,7 @@ mod tests {
use meilisearch_types::milli::update::IndexDocumentsMethod::{
ReplaceDocuments, UpdateDocuments,
};
use meilisearch_types::tasks::IndexSwap;
use meilisearch_types::VERSION_FILE_NAME;
use tempfile::TempDir;
use time::Duration;
@ -1543,7 +1544,10 @@ mod tests {
index_scheduler
.register(KindWithContent::IndexSwap {
swaps: vec![("a".to_owned(), "b".to_owned()), ("c".to_owned(), "d".to_owned())],
swaps: vec![
IndexSwap { indexes: ("a".to_owned(), "b".to_owned()) },
IndexSwap { indexes: ("c".to_owned(), "d".to_owned()) },
],
})
.unwrap();
index_scheduler.assert_internally_consistent();
@ -1553,7 +1557,9 @@ mod tests {
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "first_swap_processed");
index_scheduler
.register(KindWithContent::IndexSwap { swaps: vec![("a".to_owned(), "c".to_owned())] })
.register(KindWithContent::IndexSwap {
swaps: vec![IndexSwap { indexes: ("a".to_owned(), "c".to_owned()) }],
})
.unwrap();
index_scheduler.assert_internally_consistent();