From c1c0dacebec81d86cf5a194a05fe31f988e43942 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 12 Oct 2026 21:08:06 +0300 Subject: [PATCH 1/2] test: assert the static-link build is admitted by ModuleHost::attach_linked_with_config Verification for tinyhumansai/openhuman#7610 (E0.3, epic #7524): the linked export must be admitted and reach Ready. Co-authored-by: Medulla --- crates/tinydocs-module/tests/static_link.rs | 38 +++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 crates/tinydocs-module/tests/static_link.rs diff --git a/crates/tinydocs-module/tests/static_link.rs b/crates/tinydocs-module/tests/static_link.rs new file mode 100644 index 0000000..4304bd9 --- /dev/null +++ b/crates/tinydocs-module/tests/static_link.rs @@ -0,0 +1,38 @@ +//! The statically linked build is admitted by a `ModuleHost` and reaches `Ready`. + +#![cfg(feature = "static-link")] + +use tinybus::{ + broker::Broker, + module::{ModuleHost, ModuleState}, + transport::memory::MemoryBus, +}; + +#[tokio::test(flavor = "multi_thread", worker_threads = 2)] +async fn linked_module_is_admitted_and_becomes_ready() { + let bus = MemoryBus::new(); + let broker = Broker::new(); + broker.clone().spawn(bus.clone()); + let host = ModuleHost::new(broker); + let info = host + .attach_linked_with_config( + tinydocs_module::linked_module().unwrap(), + serde_json::json!({}), + ) + .expect("linked module is admitted"); + assert_eq!(info.name, "tinydocs-module"); + tokio::time::timeout(std::time::Duration::from_secs(10), async { + loop { + if host + .list() + .iter() + .any(|module| matches!(module.state, ModuleState::Ready)) + { + break; + } + tokio::time::sleep(std::time::Duration::from_millis(10)).await; + } + }) + .await + .expect("linked module reaches Ready"); +} From f1692787ebd4e3ab86b07620c6fc7d0d3f9ba8e5 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Mon, 12 Oct 2026 21:23:36 +0300 Subject: [PATCH 2/2] test: allow unwrap/expect in the linked admission test Co-authored-by: Medulla --- crates/tinydocs-module/tests/static_link.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/tinydocs-module/tests/static_link.rs b/crates/tinydocs-module/tests/static_link.rs index 4304bd9..b6e69e9 100644 --- a/crates/tinydocs-module/tests/static_link.rs +++ b/crates/tinydocs-module/tests/static_link.rs @@ -1,6 +1,7 @@ //! The statically linked build is admitted by a `ModuleHost` and reaches `Ready`. #![cfg(feature = "static-link")] +#![allow(clippy::unwrap_used, clippy::expect_used)] use tinybus::{ broker::Broker,