test(engine): isolate the initial availability notifications

This commit is contained in:
skylar taylor-barrick
2026-11-12 20:28:09 -06:00
parent d7372407bb
commit d23de47288
+4 -3
View File
@@ -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);
}