From a377bc852dce23a15e12fd73f165bc17baaf8c6a Mon Sep 17 00:00:00 2001 From: Bamboo1 Date: Fri, 25 Aug 2023 10:59:48 +0800 Subject: [PATCH] fix: fix test_scheduler_continuous_stop in scheduler (#2252) * fix: fix test_scheduler_continuous_stop in scheduler Signed-off-by: ZhuZiyi * chore: add document annotation Signed-off-by: ZhuZiyi --------- Signed-off-by: ZhuZiyi --- src/mito2/src/schedule/scheduler.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mito2/src/schedule/scheduler.rs b/src/mito2/src/schedule/scheduler.rs index e59635b46219..832ed9a9c9d6 100644 --- a/src/mito2/src/schedule/scheduler.rs +++ b/src/mito2/src/schedule/scheduler.rs @@ -125,6 +125,7 @@ impl Scheduler for LocalScheduler { .map_err(|_| InvalidFlumeSenderSnafu {}.build()) } + /// if await_termination is true, scheduler will wait all tasks finished before stopping async fn stop(&self, await_termination: bool) -> Result<()> { ensure!( self.state.load(Ordering::Relaxed) == STATE_RUNNING, @@ -235,7 +236,7 @@ mod tests { let local_stop = local.clone(); tokio::spawn(async move { tokio::time::sleep(Duration::from_millis(5)).await; - local_stop.stop(false).await.unwrap(); + local_stop.stop(true).await.unwrap(); barrier_clone.wait().await; });