From 71500a4e150f80be90ada52e1e7aa316c626cc93 Mon Sep 17 00:00:00 2001 From: ManyTheFish Date: Mon, 3 Jul 2023 11:20:43 +0200 Subject: [PATCH] Update tests --- index-scheduler/src/lib.rs | 3 +- .../registered_a_task.snap | 36 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 index-scheduler/src/snapshots/lib.rs/test_task_is_processing/registered_a_task.snap diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index a9affed0b..5bab13a2d 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -1815,11 +1815,12 @@ mod tests { #[test] fn test_task_is_processing() { - let (index_scheduler, _handle) = IndexScheduler::test(true, vec![]); + let (index_scheduler, mut handle) = IndexScheduler::test(true, vec![]); index_scheduler.register(index_creation_task("index_a", "id")).unwrap(); snapshot!(snapshot_index_scheduler(&index_scheduler), name: "registered_a_task"); + handle.advance_till([Start, BatchCreated]); assert!(index_scheduler.is_task_processing().unwrap()); } diff --git a/index-scheduler/src/snapshots/lib.rs/test_task_is_processing/registered_a_task.snap b/index-scheduler/src/snapshots/lib.rs/test_task_is_processing/registered_a_task.snap new file mode 100644 index 000000000..f17bfe38f --- /dev/null +++ b/index-scheduler/src/snapshots/lib.rs/test_task_is_processing/registered_a_task.snap @@ -0,0 +1,36 @@ +--- +source: index-scheduler/src/lib.rs +--- +### Autobatching Enabled = true +### Processing Tasks: +[] +---------------------------------------------------------------------- +### All Tasks: +0 {uid: 0, status: enqueued, details: { primary_key: Some("id") }, kind: IndexCreation { index_uid: "index_a", primary_key: Some("id") }} +---------------------------------------------------------------------- +### Status: +enqueued [0,] +---------------------------------------------------------------------- +### Kind: +"indexCreation" [0,] +---------------------------------------------------------------------- +### Index Tasks: +index_a [0,] +---------------------------------------------------------------------- +### Index Mapper: + +---------------------------------------------------------------------- +### Canceled By: + +---------------------------------------------------------------------- +### Enqueued At: +[timestamp] [0,] +---------------------------------------------------------------------- +### Started At: +---------------------------------------------------------------------- +### Finished At: +---------------------------------------------------------------------- +### File Store: + +---------------------------------------------------------------------- +