mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-13 09:20:07 -06:00
test(engine): isolate the initial availability notifications
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user