From d23de47288d705e078c3870bcae3dc71ae33fabd Mon Sep 17 00:00:00 2001 From: skylar taylor-barrick Date: Thu, 12 Nov 2026 20:28:09 -0600 Subject: [PATCH] test(engine): isolate the initial availability notifications --- crates/engine/src/availability.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/engine/src/availability.rs b/crates/engine/src/availability.rs index 19b7778ddd..f78c4fb489 100644 --- a/crates/engine/src/availability.rs +++ b/crates/engine/src/availability.rs @@ -323,11 +323,12 @@ mod tests { } assert_eq!(a.exists("here"), Some(true)); assert_eq!(a.exists("gone"), Some(false)); - assert!(a.is_offline("gone") && !a.is_offline("here") && !a.is_offline("unknown")); - assert_eq!(on_caller.load(Ordering::SeqCst), 0, "never probed on the calling thread"); - // Publishing the cached answer happens before the worker invokes its waker. + // Cache publication precedes its wake callback. Check these two notifications before + // querying another unknown path, whose notification must not satisfy this assertion. wait_until("availability wake notifications", || woke.load(Ordering::SeqCst) >= 2); assert!(woke.load(Ordering::SeqCst) >= 2); + assert!(a.is_offline("gone") && !a.is_offline("here") && !a.is_offline("unknown")); + assert_eq!(on_caller.load(Ordering::SeqCst), 0, "never probed on the calling thread"); assert!(a.gone_generation() >= 2); }