Skip to content

Commit baef6af

Browse files
increase sleep time to make test not/less flaky (#5756)
* increase sleep time to make test not/less flaky * introduce SUPERVISE_LOOP_INTERVAL const
1 parent f843b88 commit baef6af

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

quickwit/quickwit-indexing/src/actors/indexing_service.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1032,6 +1032,7 @@ mod tests {
10321032
};
10331033

10341034
use super::*;
1035+
use crate::actors::merge_pipeline::SUPERVISE_LOOP_INTERVAL;
10351036

10361037
async fn spawn_indexing_service_for_test(
10371038
data_dir_path: &Path,
@@ -1605,7 +1606,7 @@ mod tests {
16051606
let observation = indexing_server_handle.process_pending_and_observe().await;
16061607
assert_eq!(observation.num_running_pipelines, 0);
16071608
assert_eq!(observation.num_running_merge_pipelines, 0);
1608-
universe.sleep(*HEARTBEAT).await;
1609+
universe.sleep(SUPERVISE_LOOP_INTERVAL).await;
16091610
// Check that the merge pipeline is also shut down as they are no more indexing pipeilne on
16101611
// the index.
16111612
assert!(universe.get_one::<MergePipeline>().is_none());

quickwit/quickwit-indexing/src/actors/merge_pipeline.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ static SPAWN_PIPELINE_SEMAPHORE: Semaphore = Semaphore::const_new(10);
6969
#[derive(Debug, Clone, Copy)]
7070
pub struct FinishPendingMergesAndShutdownPipeline;
7171

72+
pub const SUPERVISE_LOOP_INTERVAL: Duration = Duration::from_secs(1);
73+
7274
struct MergePipelineHandles {
7375
merge_planner: ActorHandle<MergePlanner>,
7476
merge_split_downloader: ActorHandle<MergeSplitDownloader>,
@@ -480,7 +482,7 @@ impl Handler<SuperviseLoop> for MergePipeline {
480482
) -> Result<(), ActorExitStatus> {
481483
self.perform_observe().await;
482484
self.perform_health_check(ctx).await?;
483-
ctx.schedule_self_msg(Duration::from_secs(1), supervise_loop_token);
485+
ctx.schedule_self_msg(SUPERVISE_LOOP_INTERVAL, supervise_loop_token);
484486
Ok(())
485487
}
486488
}

0 commit comments

Comments
 (0)