From ed99d1f5701130da2d69d6b9398533ba65ae4de4 Mon Sep 17 00:00:00 2001 From: Richie McIlroy <33632126+richiemcilroy@users.noreply.github.com> Date: Sat, 24 Oct 2026 00:41:17 +0100 Subject: [PATCH] fix(editor): keep the OS memory pressure source out of audio cache unit tests --- crates/editor/src/audio.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/crates/editor/src/audio.rs b/crates/editor/src/audio.rs index 4ce868e3a90..278a40fa66a 100644 --- a/crates/editor/src/audio.rs +++ b/crates/editor/src/audio.rs @@ -1834,7 +1834,14 @@ mod memory_pressure { /// Installs one process-wide memory pressure source. It lives for the /// rest of the process, so it is never released. + /// + /// Not installed in unit tests: a real pressure event on the host would + /// release the caches of every test running in the process at once. + /// Tests drive `on_memory_pressure` directly instead. pub(super) fn watch() { + if cfg!(test) { + return; + } static WATCH: std::sync::Once = std::sync::Once::new(); WATCH.call_once(|| unsafe { let source = dispatch_source_create(