diff --git a/crates/gpui2/src/app/test_context.rs b/crates/gpui2/src/app/test_context.rs index f78162589ead3c73eded6d562a69111cc1f7ebef..8b26bb18150fb2d48e1632cda95e6382f9bfa3dd 100644 --- a/crates/gpui2/src/app/test_context.rs +++ b/crates/gpui2/src/app/test_context.rs @@ -354,6 +354,7 @@ impl Model { }) }); + // Run other tasks until the event is emitted. loop { match rx.try_next() { Ok(Some(event)) => return event, diff --git a/crates/gpui2/src/executor.rs b/crates/gpui2/src/executor.rs index 21b67b445d0c964d99fdd6e52ceb40671b69eedc..cf138a90db1b177e052d79788754d446474ce5be 100644 --- a/crates/gpui2/src/executor.rs +++ b/crates/gpui2/src/executor.rs @@ -245,7 +245,7 @@ impl BackgroundExecutor { } #[cfg(any(test, feature = "test-support"))] - pub fn deprioritize_task(&self, task_label: TaskLabel) { + pub fn deprioritize(&self, task_label: TaskLabel) { self.dispatcher.as_test().unwrap().deprioritize(task_label) } diff --git a/crates/project2/src/project_tests.rs b/crates/project2/src/project_tests.rs index e607b307661977fd7505d64eca6b43523b50a6c3..9eb9a49e49e2930ba1b133b27b8f8fcf799a261e 100644 --- a/crates/project2/src/project_tests.rs +++ b/crates/project2/src/project_tests.rs @@ -2609,7 +2609,7 @@ async fn test_file_changes_multiple_times_on_disk(cx: &mut gpui::TestAppContext) // Simulate buffer diffs being slow, so that they don't complete before // the next file change occurs. - cx.executor().deprioritize_task(*language::BUFFER_DIFF_TASK); + cx.executor().deprioritize(*language::BUFFER_DIFF_TASK); // Change the buffer's file on disk, and then wait for the file change // to be detected by the worktree, so that the buffer starts reloading.