From d9d52dd4a55b1197577b181f01487125fb4f5698 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 30 Nov 2026 15:19:59 +0000 Subject: simtest: a node no party lists gets nothing of a set --- src/simtest/holding.rs | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) (limited to 'src/simtest/holding.rs') diff --git a/src/simtest/holding.rs b/src/simtest/holding.rs index 66d5d15..4b3277a 100644 --- a/src/simtest/holding.rs +++ b/src/simtest/holding.rs @@ -1983,3 +1983,52 @@ async fn a_node_of_a_set_joins_with_nothing_but_the_stores_id() { }) .await; } + +/// d is of lass, which doesn't list it: given the store's ID, it reaches a, which takes +/// none of its handshakes and gives it nothing, neither the root nor an event. It never +/// holds the store. +#[tokio::test(flavor = "multi_thread", worker_threads = 4)] +async fn a_node_no_party_lists_gets_nothing_of_a_set() { + use crate::federation::store::passing; + + let sim = Sim::with_identity(95); + let (tv, lass, _) = three(); + let (_, root, id) = federation(&[(&tv, &["a", "b"]), (&lass, &["c"])]); + let a = start_on_a_set(&sim, "a", "tv", id, a_set(&root), None, false); + let b = start_on_a_set(&sim, "b", "tv", id, a_set(&root), None, false); + sim.wait_ready(&[&a, &b], SOON).await; + let write = tv.write(&[id], "home/tv/x", s("1")); + put(&a, &[&write]).await; + let pair = &[&a, &b]; + sim.wait_until( + "a and b hold each other's entries", + SOON, + move || async move { pair.iter().all(|node| entries(node) == 2) }, + ) + .await; + + let d = sim.start_with( + "d", + &["a"], + Start::FromDocument(Origin::Root), + move |config| { + config.store = Some(id); + config.holding = holding("lass").carrying_if( + Some(held::Begun::Start(passing::Start::new( + id, + id, + Duration::from_secs(600), + ))), + None, + Arc::new(Files::default()), + ); + }, + ); + // Long enough for it to have joined, were it let in. + tokio::time::sleep(Duration::from_secs(4)).await; + assert!(!d.is_ready().await); + assert!(read(&d, |_| ()).is_none()); + assert!(!d.holding.start_wants().is_empty()); + // And a holds no entry of it. + assert_eq!(entries(&a), 2); +} -- cgit v1.3.1