diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bb5a49643..cbad34c4a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,15 +143,15 @@ jobs: uses: taiki-e/install-action@nextest - name: Run tests - run: cargo nextest run -F test --exclude zenoh-examples --exclude zenoh-plugin-example --workspace + run: cargo nextest run -F test -F internal_config --exclude zenoh-examples --exclude zenoh-plugin-example --workspace - name: Run tests with SHM if: ${{ matrix.os == 'macOS-latest' || matrix.os == 'windows-latest' }} - run: cargo nextest run -F test -F shared-memory -F unstable -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace + run: cargo nextest run -F test -F shared-memory -F unstable -F internal_config -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace - name: Run tests with SHM + unixpipe if: ${{ matrix.os == 'ubuntu-latest' }} - run: cargo nextest run -F test -F shared-memory -F unstable -F transport_unixpipe -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace + run: cargo nextest run -F test -F shared-memory -F unstable -F internal_config -F transport_unixpipe -E 'not (test(test_default_features))' --exclude zenoh-examples --exclude zenoh-plugin-example --workspace - name: Check for feature leaks if: ${{ matrix.os == 'ubuntu-latest' }} diff --git a/examples/Cargo.toml b/examples/Cargo.toml index af948d5b2..3e5283b61 100644 --- a/examples/Cargo.toml +++ b/examples/Cargo.toml @@ -127,17 +127,14 @@ path = "examples/z_forward.rs" [[example]] name = "z_liveliness" path = "examples/z_liveliness.rs" -required-features = ["unstable"] [[example]] name = "z_sub_liveliness" path = "examples/z_sub_liveliness.rs" -required-features = ["unstable"] [[example]] name = "z_get_liveliness" path = "examples/z_get_liveliness.rs" -required-features = ["unstable"] [[example]] name = "z_pub_thr" diff --git a/zenoh-ext/examples/Cargo.toml b/zenoh-ext/examples/Cargo.toml index 688c044d6..fc4cb22dc 100644 --- a/zenoh-ext/examples/Cargo.toml +++ b/zenoh-ext/examples/Cargo.toml @@ -34,7 +34,7 @@ default = [] [dependencies] tokio = { workspace = true, features = ["rt", "sync", "time", "macros", "io-std"] } futures = { workspace = true } -zenoh = { workspace = true, features = ["unstable"], default-features = false } +zenoh = { workspace = true, features = ["unstable", "internal_config"], default-features = false } clap = { workspace = true, features = ["derive"] } zenoh-ext = { workspace = true, features = ["unstable"] } diff --git a/zenoh/Cargo.toml b/zenoh/Cargo.toml index 1359bdd1b..acc6e2617 100644 --- a/zenoh/Cargo.toml +++ b/zenoh/Cargo.toml @@ -64,7 +64,7 @@ transport_udp = ["zenoh-transport/transport_udp"] transport_unixsock-stream = ["zenoh-transport/transport_unixsock-stream"] transport_ws = ["zenoh-transport/transport_ws"] transport_vsock = ["zenoh-transport/transport_vsock"] -unstable = ["internal_config", "zenoh-keyexpr/unstable", "zenoh-config/unstable"] +unstable = ["zenoh-keyexpr/unstable", "zenoh-config/unstable"] internal_config = [] [dependencies] diff --git a/zenoh/src/api/liveliness.rs b/zenoh/src/api/liveliness.rs index 3e4b0d696..c70b67323 100644 --- a/zenoh/src/api/liveliness.rs +++ b/zenoh/src/api/liveliness.rs @@ -93,13 +93,10 @@ use crate::{ /// } /// # } /// ``` - -#[zenoh_macros::unstable] pub struct Liveliness<'a> { pub(crate) session: &'a Session, } -#[zenoh_macros::unstable] impl<'a> Liveliness<'a> { /// Create a [`LivelinessToken`](LivelinessToken) for the given key expression. /// @@ -120,7 +117,6 @@ impl<'a> Liveliness<'a> { /// .unwrap(); /// # } /// ``` - #[zenoh_macros::unstable] pub fn declare_token<'b, TryIntoKeyExpr>( &self, key_expr: TryIntoKeyExpr, @@ -157,7 +153,6 @@ impl<'a> Liveliness<'a> { /// } /// # } /// ``` - #[zenoh_macros::unstable] pub fn declare_subscriber<'b, TryIntoKeyExpr>( &self, key_expr: TryIntoKeyExpr, @@ -194,7 +189,6 @@ impl<'a> Liveliness<'a> { /// } /// # } /// ``` - #[zenoh_macros::unstable] pub fn get<'b, TryIntoKeyExpr>( &self, key_expr: TryIntoKeyExpr, @@ -205,7 +199,7 @@ impl<'a> Liveliness<'a> { { let key_expr = key_expr.try_into().map_err(Into::into); let timeout = { - let conf = self.session.0.runtime.config().lock(); + let conf = &self.session.0.runtime.config().lock().0; Duration::from_millis(unwrap_or_default!(conf.queries_default_timeout())) }; LivelinessGetBuilder { @@ -233,19 +227,16 @@ impl<'a> Liveliness<'a> { /// # } /// ``` #[must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`"] -#[zenoh_macros::unstable] #[derive(Debug)] pub struct LivelinessTokenBuilder<'a, 'b> { pub(crate) session: &'a Session, pub(crate) key_expr: ZResult>, } -#[zenoh_macros::unstable] impl Resolvable for LivelinessTokenBuilder<'_, '_> { type To = ZResult; } -#[zenoh_macros::unstable] impl Wait for LivelinessTokenBuilder<'_, '_> { #[inline] fn wait(self) -> ::To { @@ -262,7 +253,6 @@ impl Wait for LivelinessTokenBuilder<'_, '_> { } } -#[zenoh_macros::unstable] impl IntoFuture for LivelinessTokenBuilder<'_, '_> { type Output = ::To; type IntoFuture = Ready<::To>; @@ -296,7 +286,6 @@ impl IntoFuture for LivelinessTokenBuilder<'_, '_> { /// .unwrap(); /// # } /// ``` -#[zenoh_macros::unstable] #[must_use = "Liveliness tokens will be immediately dropped and undeclared if not bound to a variable"] #[derive(Debug)] pub struct LivelinessToken { @@ -323,22 +312,18 @@ pub struct LivelinessToken { /// # } /// ``` #[must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`"] -#[zenoh_macros::unstable] pub struct LivelinessTokenUndeclaration(LivelinessToken); -#[zenoh_macros::unstable] impl Resolvable for LivelinessTokenUndeclaration { type To = ZResult<()>; } -#[zenoh_macros::unstable] impl Wait for LivelinessTokenUndeclaration { fn wait(mut self) -> ::To { self.0.undeclare_impl() } } -#[zenoh_macros::unstable] impl IntoFuture for LivelinessTokenUndeclaration { type Output = ::To; type IntoFuture = Ready<::To>; @@ -348,7 +333,6 @@ impl IntoFuture for LivelinessTokenUndeclaration { } } -#[zenoh_macros::unstable] impl LivelinessToken { /// Undeclare the [`LivelinessToken`]. /// @@ -379,7 +363,6 @@ impl LivelinessToken { } } -#[zenoh_macros::unstable] impl UndeclarableSealed<()> for LivelinessToken { type Undeclaration = LivelinessTokenUndeclaration; @@ -388,7 +371,6 @@ impl UndeclarableSealed<()> for LivelinessToken { } } -#[zenoh_macros::unstable] impl Drop for LivelinessToken { fn drop(&mut self) { if self.undeclare_on_drop { @@ -415,7 +397,6 @@ impl Drop for LivelinessToken { /// # } /// ``` #[must_use = "Resolvables do nothing unless you resolve them using `.await` or `zenoh::Wait::wait`"] -#[zenoh_macros::unstable] #[derive(Debug)] pub struct LivelinessSubscriberBuilder<'a, 'b, Handler, const BACKGROUND: bool = false> { pub session: &'a Session, @@ -424,7 +405,6 @@ pub struct LivelinessSubscriberBuilder<'a, 'b, Handler, const BACKGROUND: bool = pub history: bool, } -#[zenoh_macros::unstable] impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> { /// Receive the samples for this liveliness subscription with a callback. /// @@ -443,7 +423,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> { /// # } /// ``` #[inline] - #[zenoh_macros::unstable] pub fn callback(self, callback: F) -> LivelinessSubscriberBuilder<'a, 'b, Callback> where F: Fn(Sample) + Send + Sync + 'static, @@ -472,7 +451,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> { /// # } /// ``` #[inline] - #[zenoh_macros::unstable] pub fn callback_mut( self, callback: F, @@ -503,7 +481,6 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, DefaultHandler> { /// # } /// ``` #[inline] - #[zenoh_macros::unstable] pub fn with(self, handler: Handler) -> LivelinessSubscriberBuilder<'a, 'b, Handler> where Handler: IntoHandler, @@ -556,14 +533,12 @@ impl<'a, 'b> LivelinessSubscriberBuilder<'a, 'b, Callback> { impl LivelinessSubscriberBuilder<'_, '_, Handler, BACKGROUND> { #[inline] - #[zenoh_macros::unstable] pub fn history(mut self, history: bool) -> Self { self.history = history; self } } -#[zenoh_macros::unstable] impl Resolvable for LivelinessSubscriberBuilder<'_, '_, Handler> where Handler: IntoHandler + Send, @@ -572,13 +547,11 @@ where type To = ZResult>; } -#[zenoh_macros::unstable] impl Wait for LivelinessSubscriberBuilder<'_, '_, Handler> where Handler: IntoHandler + Send, Handler::Handler: Send, { - #[zenoh_macros::unstable] fn wait(self) -> ::To { use super::subscriber::SubscriberKind; @@ -606,7 +579,6 @@ where } } -#[zenoh_macros::unstable] impl IntoFuture for LivelinessSubscriberBuilder<'_, '_, Handler> where Handler: IntoHandler + Send, @@ -615,20 +587,16 @@ where type Output = ::To; type IntoFuture = Ready<::To>; - #[zenoh_macros::unstable] fn into_future(self) -> Self::IntoFuture { std::future::ready(self.wait()) } } -#[zenoh_macros::unstable] impl Resolvable for LivelinessSubscriberBuilder<'_, '_, Callback, true> { type To = ZResult<()>; } -#[zenoh_macros::unstable] impl Wait for LivelinessSubscriberBuilder<'_, '_, Callback, true> { - #[zenoh_macros::unstable] fn wait(self) -> ::To { self.session.0.declare_liveliness_subscriber_inner( &self.key_expr?, @@ -640,12 +608,10 @@ impl Wait for LivelinessSubscriberBuilder<'_, '_, Callback, true> { } } -#[zenoh_macros::unstable] impl IntoFuture for LivelinessSubscriberBuilder<'_, '_, Callback, true> { type Output = ::To; type IntoFuture = Ready<::To>; - #[zenoh_macros::unstable] fn into_future(self) -> Self::IntoFuture { std::future::ready(self.wait()) } diff --git a/zenoh/src/api/mod.rs b/zenoh/src/api/mod.rs index 6981e02f7..e5d19325c 100644 --- a/zenoh/src/api/mod.rs +++ b/zenoh/src/api/mod.rs @@ -22,7 +22,6 @@ pub(crate) mod encoding; pub(crate) mod handlers; pub(crate) mod info; pub(crate) mod key_expr; -#[cfg(feature = "unstable")] pub(crate) mod liveliness; #[cfg(feature = "plugins")] pub(crate) mod loader; diff --git a/zenoh/src/api/query.rs b/zenoh/src/api/query.rs index 8eff89831..3e1f66ed1 100644 --- a/zenoh/src/api/query.rs +++ b/zenoh/src/api/query.rs @@ -146,7 +146,6 @@ impl From for Result { } } -#[cfg(feature = "unstable")] pub(crate) struct LivelinessQueryState { pub(crate) callback: Callback, } diff --git a/zenoh/src/api/session.rs b/zenoh/src/api/session.rs index cdd1f464c..e6455cab2 100644 --- a/zenoh/src/api/session.rs +++ b/zenoh/src/api/session.rs @@ -11,10 +11,8 @@ // Contributors: // ZettaScale Zenoh Team, // -#[cfg(feature = "unstable")] -use std::collections::hash_map::Entry; use std::{ - collections::HashMap, + collections::{hash_map::Entry, HashMap}, convert::TryInto, fmt, ops::Deref, @@ -39,11 +37,7 @@ use zenoh_config::{qos::PublisherQoSConfig, unwrap_or_default, wrappers::ZenohId use zenoh_core::{zconfigurable, zread, Resolve, ResolveClosure, ResolveFuture, Wait}; use zenoh_keyexpr::keyexpr_tree::KeBoxTree; #[cfg(feature = "unstable")] -use zenoh_protocol::network::{ - declare::{DeclareToken, SubscriberId, TokenId, UndeclareToken}, - ext, - interest::InterestId, -}; +use zenoh_protocol::network::declare::SubscriberId; use zenoh_protocol::{ core::{ key_expr::{keyexpr, OwnedKeyExpr}, @@ -54,10 +48,11 @@ use zenoh_protocol::{ self, declare::{ self, common::ext::WireExprType, queryable::ext::QueryableInfoType, Declare, - DeclareBody, DeclareKeyExpr, DeclareQueryable, DeclareSubscriber, UndeclareQueryable, - UndeclareSubscriber, + DeclareBody, DeclareKeyExpr, DeclareQueryable, DeclareSubscriber, DeclareToken, + TokenId, UndeclareQueryable, UndeclareSubscriber, UndeclareToken, }, - interest::{InterestMode, InterestOptions}, + ext, + interest::{InterestId, InterestMode, InterestOptions}, push, request, AtomicRequestId, DeclareFinal, Interest, Mapping, Push, Request, RequestId, Response, ResponseFinal, }, @@ -78,10 +73,9 @@ use crate::api::selector::ZenohParameters; #[cfg(feature = "unstable")] use crate::api::{ builders::querier::QuerierBuilder, - liveliness::Liveliness, matching::{MatchingListenerState, MatchingStatus, MatchingStatusType}, querier::QuerierState, - query::{LivelinessQueryState, ReplyKeyExpr}, + query::ReplyKeyExpr, sample::SourceInfo, }; use crate::{ @@ -102,8 +96,12 @@ use crate::{ handlers::{Callback, DefaultHandler}, info::SessionInfo, key_expr::{KeyExpr, KeyExprInner}, + liveliness::Liveliness, publisher::{Priority, PublisherState}, - query::{ConsolidationMode, QueryConsolidation, QueryState, QueryTarget, Reply}, + query::{ + ConsolidationMode, LivelinessQueryState, QueryConsolidation, QueryState, QueryTarget, + Reply, + }, queryable::{Query, QueryInner, QueryableState}, sample::{DataInfo, DataInfoIntoSample, Locality, QoS, Sample, SampleKind}, selector::Selector, @@ -130,7 +128,6 @@ pub(crate) struct SessionState { pub(crate) primitives: Option>, // @TODO replace with MaybeUninit ?? pub(crate) expr_id_counter: AtomicExprId, // @TODO: manage rollover and uniqueness pub(crate) qid_counter: AtomicRequestId, - #[cfg(feature = "unstable")] pub(crate) liveliness_qid_counter: AtomicRequestId, pub(crate) local_resources: HashMap, pub(crate) remote_resources: HashMap, @@ -139,7 +136,6 @@ pub(crate) struct SessionState { pub(crate) publishers: HashMap, #[cfg(feature = "unstable")] pub(crate) queriers: HashMap, - #[cfg(feature = "unstable")] pub(crate) remote_tokens: HashMap>, //pub(crate) publications: Vec, pub(crate) subscribers: HashMap>, @@ -150,7 +146,6 @@ pub(crate) struct SessionState { #[cfg(feature = "unstable")] pub(crate) matching_listeners: HashMap>, pub(crate) queries: HashMap, - #[cfg(feature = "unstable")] pub(crate) liveliness_queries: HashMap, pub(crate) aggregated_subscribers: Vec, pub(crate) aggregated_publishers: Vec, @@ -167,7 +162,6 @@ impl SessionState { primitives: None, expr_id_counter: AtomicExprId::new(1), // Note: start at 1 because 0 is reserved for NO_RESOURCE qid_counter: AtomicRequestId::new(0), - #[cfg(feature = "unstable")] liveliness_qid_counter: AtomicRequestId::new(0), local_resources: HashMap::new(), remote_resources: HashMap::new(), @@ -176,7 +170,6 @@ impl SessionState { publishers: HashMap::new(), #[cfg(feature = "unstable")] queriers: HashMap::new(), - #[cfg(feature = "unstable")] remote_tokens: HashMap::new(), //publications: Vec::new(), subscribers: HashMap::new(), @@ -187,7 +180,6 @@ impl SessionState { #[cfg(feature = "unstable")] matching_listeners: HashMap::new(), queries: HashMap::new(), - #[cfg(feature = "unstable")] liveliness_queries: HashMap::new(), aggregated_subscribers, aggregated_publishers, @@ -1041,7 +1033,6 @@ impl Session { /// .unwrap(); /// # } /// ``` - #[zenoh_macros::unstable] pub fn liveliness(&self) -> Liveliness<'_> { Liveliness { session: self } } @@ -1614,7 +1605,6 @@ impl SessionInner { } } SubscriberKind::LivelinessSubscriber => { - #[cfg(feature = "unstable")] if kind == SubscriberKind::LivelinessSubscriber { let primitives = state.primitives()?; drop(state); @@ -1736,7 +1726,6 @@ impl SessionInner { } } - #[zenoh_macros::unstable] pub(crate) fn declare_liveliness_inner(&self, key_expr: &KeyExpr) -> ZResult { tracing::trace!("declare_liveliness({:?})", key_expr); let id = self.runtime.next_id(); @@ -1754,7 +1743,6 @@ impl SessionInner { Ok(id) } - #[cfg(feature = "unstable")] pub(crate) fn declare_liveliness_subscriber_inner( &self, key_expr: &KeyExpr, @@ -1831,7 +1819,6 @@ impl SessionInner { reliability: Reliability::Reliable, #[cfg(feature = "unstable")] source_info: SourceInfo::empty(), - #[cfg(feature = "unstable")] attachment: None, }); } @@ -1855,7 +1842,6 @@ impl SessionInner { Ok(sub_state) } - #[zenoh_macros::unstable] pub(crate) fn undeclare_liveliness(&self, tid: Id) -> ZResult<()> { let Ok(primitives) = zread!(self.state).primitives() else { return Ok(()); @@ -2276,8 +2262,6 @@ impl SessionInner { self.task_controller .spawn_with_rt(zenoh_runtime::ZRuntime::Net, { let session = WeakSession::new(self); - #[cfg(feature = "unstable")] - let zid = self.zid(); async move { tokio::select! { _ = tokio::time::sleep(timeout) => { @@ -2293,7 +2277,7 @@ impl SessionInner { query.callback.call(Reply { result: Err(ReplyError::new("Timeout", Encoding::ZENOH_STRING)), #[cfg(feature = "unstable")] - replier_id: Some(zid.into()), + replier_id: Some(session.zid().into()), }); } } @@ -2368,7 +2352,6 @@ impl SessionInner { Ok(()) } - #[cfg(feature = "unstable")] pub(crate) fn liveliness_query( self: &Arc, key_expr: &KeyExpr<'_>, @@ -2382,7 +2365,6 @@ impl SessionInner { self.task_controller .spawn_with_rt(zenoh_runtime::ZRuntime::Net, { let session = WeakSession::new(self); - let zid = self.zid(); async move { tokio::select! { _ = tokio::time::sleep(timeout) => { @@ -2393,7 +2375,7 @@ impl SessionInner { query.callback.call(Reply { result: Err(ReplyError::new("Timeout", Encoding::ZENOH_STRING)), #[cfg(feature = "unstable")] - replier_id: Some(zid.into()), + replier_id: Some(session.zid().into()), }); } } @@ -2645,9 +2627,6 @@ impl Primitives for WeakSession { } } } - #[cfg(not(feature = "unstable"))] - zenoh_protocol::network::DeclareBody::DeclareToken(_) => {} - #[cfg(feature = "unstable")] zenoh_protocol::network::DeclareBody::DeclareToken(m) => { let mut state = zwrite!(self.state); if state.primitives.is_none() { @@ -2672,7 +2651,6 @@ impl Primitives for WeakSession { reliability: Reliability::Reliable, #[cfg(feature = "unstable")] source_info: SourceInfo::empty(), - #[cfg(feature = "unstable")] attachment: None, }), #[cfg(feature = "unstable")] @@ -2695,7 +2673,6 @@ impl Primitives for WeakSession { SubscriberKind::LivelinessSubscriber, #[cfg(feature = "unstable")] Reliability::Reliable, - #[cfg(feature = "unstable")] None, ); } @@ -2707,7 +2684,6 @@ impl Primitives for WeakSession { } zenoh_protocol::network::DeclareBody::UndeclareToken(m) => { trace!("recv UndeclareToken {:?}", m.id); - #[cfg(feature = "unstable")] { let mut state = zwrite!(self.state); if state.primitives.is_none() { @@ -2729,7 +2705,6 @@ impl Primitives for WeakSession { SubscriberKind::LivelinessSubscriber, #[cfg(feature = "unstable")] Reliability::Reliable, - #[cfg(feature = "unstable")] None, ); } else if m.ext_wire_expr.wire_expr != WireExpr::empty() { @@ -2753,7 +2728,6 @@ impl Primitives for WeakSession { SubscriberKind::LivelinessSubscriber, #[cfg(feature = "unstable")] Reliability::Reliable, - #[cfg(feature = "unstable")] None, ); } @@ -2769,8 +2743,6 @@ impl Primitives for WeakSession { } DeclareBody::DeclareFinal(DeclareFinal) => { trace!("recv DeclareFinal {:?}", msg.interest_id); - - #[cfg(feature = "unstable")] if let Some(interest_id) = msg.interest_id { let mut state = zwrite!(self.state); let _ = state.liveliness_queries.remove(&interest_id); diff --git a/zenoh/src/lib.rs b/zenoh/src/lib.rs index 119ee3453..643b0e134 100644 --- a/zenoh/src/lib.rs +++ b/zenoh/src/lib.rs @@ -386,7 +386,7 @@ pub mod scouting { /// Liveliness primitives /// /// A [`LivelinessToken`](liveliness::LivelinessToken) is a token which liveliness is tied -/// to the Zenoh [`Session`](Session) and can be monitored by remote applications. +/// to the Zenoh [`Session`] and can be monitored by remote applications. /// /// # Examples /// ### Declaring a token @@ -434,7 +434,6 @@ pub mod scouting { /// } /// # } /// ``` -#[zenoh_macros::unstable] pub mod liveliness { pub use crate::api::liveliness::{ Liveliness, LivelinessGetBuilder, LivelinessSubscriberBuilder, LivelinessToken, diff --git a/zenoh/src/net/runtime/adminspace.rs b/zenoh/src/net/runtime/adminspace.rs index 33ed04eb1..6271bcf05 100644 --- a/zenoh/src/net/runtime/adminspace.rs +++ b/zenoh/src/net/runtime/adminspace.rs @@ -244,7 +244,7 @@ impl AdminSpace { let requested_plugins = { let cfg_guard = admin.context.runtime.state.config.lock(); - cfg_guard.plugins().load_requests().collect::>() + cfg_guard.0.plugins().load_requests().collect::>() }; let mut diffs = Vec::new(); for plugin in active_plugins.keys() { diff --git a/zenoh/tests/liveliness.rs b/zenoh/tests/liveliness.rs index 968b24303..b88ac922b 100644 --- a/zenoh/tests/liveliness.rs +++ b/zenoh/tests/liveliness.rs @@ -11,10 +11,10 @@ // Contributors: // ZettaScale Zenoh Team, // -#[cfg(feature = "unstable")] +#![cfg(feature = "internal_config")] + use zenoh_core::ztimeout; -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_clique() { use std::time::Duration; @@ -77,7 +77,6 @@ async fn test_liveliness_subscriber_clique() { peer2.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_query_clique() { use std::time::Duration; @@ -134,7 +133,6 @@ async fn test_liveliness_query_clique() { peer2.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_brokered() { use std::time::Duration; @@ -213,7 +211,6 @@ async fn test_liveliness_subscriber_brokered() { client2.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_query_brokered() { use std::time::Duration; @@ -284,7 +281,6 @@ async fn test_liveliness_query_brokered() { client2.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_local() { use std::time::Duration; @@ -327,7 +323,6 @@ async fn test_liveliness_subscriber_local() { peer.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_query_local() { use std::time::Duration; @@ -362,7 +357,6 @@ async fn test_liveliness_query_local() { peer.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_after_close() { use std::time::Duration; @@ -421,7 +415,6 @@ async fn test_liveliness_after_close() { /// ------------------------------------------------------- /// DOUBLE CLIENT /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_client_before() { use std::time::Duration; @@ -516,7 +509,6 @@ async fn test_liveliness_subscriber_double_client_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_client_middle() { use std::time::Duration; @@ -614,7 +606,6 @@ async fn test_liveliness_subscriber_double_client_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_client_after() { use std::time::Duration; @@ -714,7 +705,6 @@ async fn test_liveliness_subscriber_double_client_after() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_client_history_before() { use std::time::Duration; @@ -817,7 +807,6 @@ async fn test_liveliness_subscriber_double_client_history_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_client_history_middle() { use std::time::Duration; @@ -920,7 +909,6 @@ async fn test_liveliness_subscriber_double_client_history_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_client_history_after() { use std::time::Duration; @@ -1025,7 +1013,6 @@ async fn test_liveliness_subscriber_double_client_history_after() { /// ------------------------------------------------------- /// DOUBLE PEER /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_peer_before() { use std::time::Duration; @@ -1114,7 +1101,6 @@ async fn test_liveliness_subscriber_double_peer_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_peer_middle() { use std::time::Duration; @@ -1206,7 +1192,6 @@ async fn test_liveliness_subscriber_double_peer_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_peer_after() { use std::time::Duration; @@ -1300,7 +1285,6 @@ async fn test_liveliness_subscriber_double_peer_after() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_peer_history_before() { use std::time::Duration; @@ -1403,7 +1387,6 @@ async fn test_liveliness_subscriber_double_peer_history_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_peer_history_middle() { use std::time::Duration; @@ -1506,7 +1489,6 @@ async fn test_liveliness_subscriber_double_peer_history_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_peer_history_after() { use std::time::Duration; @@ -1611,7 +1593,6 @@ async fn test_liveliness_subscriber_double_peer_history_after() { /// ------------------------------------------------------- /// DOUBLE ROUTER /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_router_before() { use std::time::Duration; @@ -1711,7 +1692,6 @@ async fn test_liveliness_subscriber_double_router_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_router_middle() { use std::time::Duration; @@ -1814,7 +1794,6 @@ async fn test_liveliness_subscriber_double_router_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_router_after() { use std::time::Duration; @@ -1919,7 +1898,6 @@ async fn test_liveliness_subscriber_double_router_after() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_router_history_before() { use std::time::Duration; @@ -2027,7 +2005,6 @@ async fn test_liveliness_subscriber_double_router_history_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_router_history_middle() { use std::time::Duration; @@ -2135,7 +2112,6 @@ async fn test_liveliness_subscriber_double_router_history_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_router_history_after() { use std::time::Duration; @@ -2245,7 +2221,6 @@ async fn test_liveliness_subscriber_double_router_history_after() { /// ------------------------------------------------------- /// DOUBLE CLIENT VIA PEER /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_clientviapeer_before() { use std::time::Duration; @@ -2359,7 +2334,6 @@ async fn test_liveliness_subscriber_double_clientviapeer_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_clientviapeer_middle() { use std::time::Duration; @@ -2476,7 +2450,6 @@ async fn test_liveliness_subscriber_double_clientviapeer_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_clientviapeer_after() { use std::time::Duration; @@ -2595,7 +2568,6 @@ async fn test_liveliness_subscriber_double_clientviapeer_after() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_clientviapeer_history_before() { use std::time::Duration; @@ -2718,7 +2690,6 @@ async fn test_liveliness_subscriber_double_clientviapeer_history_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_clientviapeer_history_middle() { use std::time::Duration; @@ -2841,7 +2812,6 @@ async fn test_liveliness_subscriber_double_clientviapeer_history_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subscriber_double_clientviapeer_history_after() { use std::time::Duration; @@ -2966,7 +2936,6 @@ async fn test_liveliness_subscriber_double_clientviapeer_history_after() { /// ------------------------------------------------------- /// SUBGET CLIENT /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_client_before() { use std::time::Duration; @@ -3059,7 +3028,6 @@ async fn test_liveliness_subget_client_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_client_middle() { use std::time::Duration; @@ -3157,7 +3125,6 @@ async fn test_liveliness_subget_client_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_client_history_before() { use std::time::Duration; @@ -3254,7 +3221,6 @@ async fn test_liveliness_subget_client_history_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_client_history_middle() { use std::time::Duration; @@ -3356,7 +3322,6 @@ async fn test_liveliness_subget_client_history_middle() { /// ------------------------------------------------------- /// SUBGET PEER /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_peer_before() { use std::time::Duration; @@ -3449,7 +3414,6 @@ async fn test_liveliness_subget_peer_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_peer_middle() { use std::time::Duration; @@ -3547,7 +3511,6 @@ async fn test_liveliness_subget_peer_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_peer_history_before() { use std::time::Duration; @@ -3644,7 +3607,6 @@ async fn test_liveliness_subget_peer_history_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_peer_history_middle() { use std::time::Duration; @@ -3746,7 +3708,6 @@ async fn test_liveliness_subget_peer_history_middle() { /// ------------------------------------------------------- /// SUBGET ROUTER /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_router_before() { use std::time::Duration; @@ -3844,7 +3805,6 @@ async fn test_liveliness_subget_router_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_router_middle() { use std::time::Duration; @@ -3947,7 +3907,6 @@ async fn test_liveliness_subget_router_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_router_history_before() { use std::time::Duration; @@ -4049,7 +4008,6 @@ async fn test_liveliness_subget_router_history_before() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_subget_router_history_middle() { use std::time::Duration; @@ -4153,7 +4111,6 @@ async fn test_liveliness_subget_router_history_middle() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_regression_1() { use std::time::Duration; @@ -4237,7 +4194,6 @@ async fn test_liveliness_regression_1() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_regression_2() { use std::time::Duration; @@ -4331,7 +4287,6 @@ async fn test_liveliness_regression_2() { peer_sub.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_regression_2_history() { use std::time::Duration; @@ -4432,7 +4387,6 @@ async fn test_liveliness_regression_2_history() { peer_sub.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_regression_3() { use std::time::Duration; @@ -4538,7 +4492,6 @@ async fn test_liveliness_regression_3() { router.close().await.unwrap(); } -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_issue_1470() { // https://github.com/eclipse-zenoh/zenoh/issues/1470 @@ -4722,7 +4675,6 @@ async fn test_liveliness_issue_1470() { /// ------------------------------------------------------- /// DOUBLE UNDECLARE CLIQUE /// ------------------------------------------------------- -#[cfg(feature = "unstable")] #[tokio::test(flavor = "multi_thread", worker_threads = 4)] async fn test_liveliness_double_undeclare_clique() { use std::time::Duration; diff --git a/zenoh/tests/matching.rs b/zenoh/tests/matching.rs index 503c1f5e4..c5cab1dff 100644 --- a/zenoh/tests/matching.rs +++ b/zenoh/tests/matching.rs @@ -12,6 +12,7 @@ // ZettaScale Zenoh Team, // #![cfg(feature = "unstable")] +#![cfg(feature = "internal_config")] use std::time::Duration; diff --git a/zenoh/tests/routing.rs b/zenoh/tests/routing.rs index 1250e1479..83dcc2d3d 100644 --- a/zenoh/tests/routing.rs +++ b/zenoh/tests/routing.rs @@ -31,7 +31,6 @@ use zenoh_result::bail; const TIMEOUT: Duration = Duration::from_secs(10); const MSG_COUNT: usize = 50; -#[cfg(feature = "unstable")] const LIVELINESSGET_DELAY: Duration = Duration::from_millis(10); #[derive(Debug, Clone, PartialEq, Eq)] @@ -40,13 +39,9 @@ enum Task { Sub(String, usize), Queryable(String, usize), Get(String, usize), - #[cfg(feature = "unstable")] Liveliness(String), - #[cfg(feature = "unstable")] LivelinessGet(String), - #[cfg(feature = "unstable")] LivelinessLoop(String), - #[cfg(feature = "unstable")] LivelinessSub(String), Sleep(Duration), Wait, @@ -155,7 +150,6 @@ impl Task { println!("Get got sufficient amount of messages. Done."); } - #[cfg(feature = "unstable")] // The Liveliness task. Self::Liveliness(ke) => { let _liveliness = ztimeout!(session.liveliness().declare_token(ke))?; @@ -164,7 +158,6 @@ impl Task { println!("Liveliness task done."); } - #[cfg(feature = "unstable")] // The LivelinessGet task. Self::LivelinessGet(ke) => { let mut counter = 0; @@ -192,7 +185,6 @@ impl Task { } // The LivelinessLoop task. - #[cfg(feature = "unstable")] Self::LivelinessLoop(ke) => { let mut liveliness: Option = None; @@ -221,7 +213,6 @@ impl Task { println!("LivelinessLoop task done."); } - #[cfg(feature = "unstable")] // The LivelinessSub task. Self::LivelinessSub(ke) => { let sub = ztimeout!(session.liveliness().declare_subscriber(ke))?; diff --git a/zenoh/tests/shm.rs b/zenoh/tests/shm.rs index 327ad76c0..50194e766 100644 --- a/zenoh/tests/shm.rs +++ b/zenoh/tests/shm.rs @@ -11,7 +11,11 @@ // Contributors: // ZettaScale Zenoh Team, // -#![cfg(all(feature = "unstable", feature = "shared-memory"))] +#![cfg(all( + feature = "unstable", + feature = "shared-memory", + feature = "internal_config" +))] use std::{ sync::{ atomic::{AtomicUsize, Ordering}, diff --git a/zenohd/Cargo.toml b/zenohd/Cargo.toml index a422b0e6c..7a75ae6c3 100644 --- a/zenohd/Cargo.toml +++ b/zenohd/Cargo.toml @@ -44,6 +44,7 @@ zenoh = { workspace = true, features = [ "internal", "plugins", "runtime_plugins", + "internal_config", ] } zenoh-config = { workspace = true }