From efe7f611283c525a5bebdc0f43a21c241a028b41 Mon Sep 17 00:00:00 2001 From: Antonio Scandurra Date: Tue, 1 Mar 2022 19:17:38 +0100 Subject: [PATCH] Use `simulate_random_delay` when polling snapshot only in tests Co-Authored-By: Nathan Sobo Co-Authored-By: Max Brunsfeld --- crates/project/src/worktree.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/project/src/worktree.rs b/crates/project/src/worktree.rs index 33a564585a..59498a3d75 100644 --- a/crates/project/src/worktree.rs +++ b/crates/project/src/worktree.rs @@ -386,6 +386,7 @@ impl Worktree { if worktree.poll_task.is_none() { worktree.poll_task = Some(cx.spawn_weak(|this, mut cx| async move { if is_fake_fs { + #[cfg(any(test, feature = "test-support"))] cx.background().simulate_random_delay().await; } else { smol::Timer::after(Duration::from_millis(100)).await;