From 9a74ea09439528d09726026eaa918df252c93b25 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Lecrenier?= Date: Tue, 11 Oct 2022 11:58:33 +0200 Subject: [PATCH] Fix compiler errors related autobatching option of the index scheduler --- index-scheduler/src/lib.rs | 6 +++--- index-scheduler/src/snapshot.rs | 4 ++++ .../index_scheduler__tests__document_addition-2.snap | 1 + .../index_scheduler__tests__document_addition-3.snap | 1 + .../index_scheduler__tests__document_addition.snap | 1 + ...tests__insert_task_while_another_task_is_processing.snap | 1 + .../src/snapshots/index_scheduler__tests__register.snap | 1 + .../index_scheduler__tests__task_deletion_deleteable-2.snap | 1 + .../index_scheduler__tests__task_deletion_deleteable-3.snap | 1 + .../index_scheduler__tests__task_deletion_deleteable.snap | 1 + ...ndex_scheduler__tests__task_deletion_undeleteable-2.snap | 1 + ...ndex_scheduler__tests__task_deletion_undeleteable-3.snap | 1 + ...ndex_scheduler__tests__task_deletion_undeleteable-4.snap | 1 + .../index_scheduler__tests__task_deletion_undeleteable.snap | 1 + 14 files changed, 19 insertions(+), 3 deletions(-) diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index d7b5f95c0..6aa100e10 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -570,7 +570,7 @@ mod tests { #[test] fn register() { // In this test, the handle doesn't make any progress, we only check that the tasks are registered - let (index_scheduler, _handle) = IndexScheduler::test(); + let (index_scheduler, _handle) = IndexScheduler::test(true); let kinds = [ index_creation_task("catto", "mouse"), @@ -688,7 +688,7 @@ mod tests { #[test] fn task_deletion_undeleteable() { - let (index_scheduler, handle) = IndexScheduler::test(); + let (index_scheduler, handle) = IndexScheduler::test(true); let to_enqueue = [ index_creation_task("catto", "mouse"), @@ -730,7 +730,7 @@ mod tests { #[test] fn task_deletion_deleteable() { - let (index_scheduler, handle) = IndexScheduler::test(); + let (index_scheduler, handle) = IndexScheduler::test(true); let (file0, documents_count0) = sample_documents(&index_scheduler, 0, 0); let (file1, documents_count1) = sample_documents(&index_scheduler, 1, 1); diff --git a/index-scheduler/src/snapshot.rs b/index-scheduler/src/snapshot.rs index 7a9ede705..790bf70a8 100644 --- a/index-scheduler/src/snapshot.rs +++ b/index-scheduler/src/snapshot.rs @@ -15,6 +15,7 @@ use crate::{ pub fn snapshot_index_scheduler(scheduler: &IndexScheduler) -> String { let IndexScheduler { + autobatching_enabled, processing_tasks, file_store: _, env, @@ -32,6 +33,9 @@ pub fn snapshot_index_scheduler(scheduler: &IndexScheduler) -> String { let mut snap = String::new(); let (_time, processing_tasks) = processing_tasks.read().unwrap().clone(); + snap.push_str(&format!( + "### Autobatching Enabled = {autobatching_enabled}\n" + )); snap.push_str("### Processing Tasks:\n"); snap.push_str(&snapshot_bitmap(&processing_tasks)); snap.push_str("\n----------------------------------------------------------------------\n"); diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-2.snap b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-2.snap index 389cc4fe1..8e0ba2082 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-2.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-2.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [0,] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-3.snap b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-3.snap index 00d0cf005..d05f00a6a 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-3.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition-3.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap index 03a2f7e55..0cd5fed11 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__document_addition.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__insert_task_while_another_task_is_processing.snap b/index-scheduler/src/snapshots/index_scheduler__tests__insert_task_while_another_task_is_processing.snap index b92fd0c61..831c9d571 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__insert_task_while_another_task_is_processing.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__insert_task_while_another_task_is_processing.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [0,] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__register.snap b/index-scheduler/src/snapshots/index_scheduler__tests__register.snap index 1e3274683..7fd457f82 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__register.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__register.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-2.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-2.snap index a426399c4..6da21f7f6 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-2.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-2.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-3.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-3.snap index 5767a5b36..f154ef96c 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-3.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable-3.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap index bc10d0f55..eb829cc79 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_deleteable.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-2.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-2.snap index bb596cbb5..442b38631 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-2.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-2.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-3.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-3.snap index 754f07564..69c993b68 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-3.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-3.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [3,] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-4.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-4.snap index 0b2da8931..a657eaa48 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-4.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable-4.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ---------------------------------------------------------------------- diff --git a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap index 38971952b..8f30eecfb 100644 --- a/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap +++ b/index-scheduler/src/snapshots/index_scheduler__tests__task_deletion_undeleteable.snap @@ -2,6 +2,7 @@ source: index-scheduler/src/lib.rs expression: snapshot_index_scheduler(&index_scheduler) --- +### Autobatching Enabled = true ### Processing Tasks: [] ----------------------------------------------------------------------