From c7aedf5494cd61fe15a4a2e0e8d7f1643d3628a0 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Sat, 28 Nov 2026 05:14:57 +0100 Subject: [PATCH] cultmesh-rs tests: an unsubscribed id is neither resent nor unsubscribed again Co-Authored-By: Claude Sonnet 5.5 --- packages/cultmesh-rs/tests/rudp_subscription.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/cultmesh-rs/tests/rudp_subscription.rs b/packages/cultmesh-rs/tests/rudp_subscription.rs index b0c9162a..0118acb0 100644 --- a/packages/cultmesh-rs/tests/rudp_subscription.rs +++ b/packages/cultmesh-rs/tests/rudp_subscription.rs @@ -416,11 +416,15 @@ fn dropping_the_client_unsubscribes_each_live_id_and_stops_its_thread() { peer.subscribe_id(); peer.subscribe_id(); assert!(matches!(peer.next(), CultNetMessage::DatabaseUnsubscribe { subscription_id, .. } if subscription_id == "two")); + // An unsubscribed id is forgotten: not resent, not unsubscribed again. + client.resubscribe_all().unwrap(); + assert_eq!(peer.subscribe_id().1, "one"); let before = thread_count(); let started = Instant::now(); drop(client); assert!(started.elapsed() < Duration::from_secs(2), "drop joins promptly"); assert!(matches!(peer.next(), CultNetMessage::DatabaseUnsubscribe { subscription_id, .. } if subscription_id == "one")); + assert!(peer.received.recv_timeout(Duration::from_millis(300)).is_err(), "nothing else is sent"); if cfg!(target_os = "linux") { assert!(thread_count() < before, "the pump thread is gone with its handle"); }