From 5346c28e931ce91576d45a9828efd04766935ea0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Oct 2025 17:01:09 +0000 Subject: [PATCH 1/3] Bump rust-vmm-ci from `fc4584d` to `58dab8b` Bumps [rust-vmm-ci](https://github.com/rust-vmm/rust-vmm-ci) from `fc4584d` to `58dab8b`. - [Commits](https://github.com/rust-vmm/rust-vmm-ci/compare/fc4584d8b805be4e8193d43d9ba6519f9a0f43a5...58dab8b1433c15e507edef64970a428c719ceda0) --- updated-dependencies: - dependency-name: rust-vmm-ci dependency-version: 58dab8b1433c15e507edef64970a428c719ceda0 dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- rust-vmm-ci | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-vmm-ci b/rust-vmm-ci index fc4584d..58dab8b 160000 --- a/rust-vmm-ci +++ b/rust-vmm-ci @@ -1 +1 @@ -Subproject commit fc4584d8b805be4e8193d43d9ba6519f9a0f43a5 +Subproject commit 58dab8b1433c15e507edef64970a428c719ceda0 From 14f77776b104406dd6762d29e363a7dc1c76f013 Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Thu, 2 Oct 2025 09:21:57 +0100 Subject: [PATCH 2/3] test: sprinkle cfg(feature = "test-utilities") Most tests do not compile without this feature, so gate the tests themselves behind it. Signed-off-by: Patrick Roy --- benches/main.rs | 14 ++++++++++++++ tests/basic_event_manager.rs | 2 ++ tests/endpoint.rs | 1 + tests/multi_threaded.rs | 2 ++ tests/regressions.rs | 2 ++ 5 files changed, 21 insertions(+) diff --git a/benches/main.rs b/benches/main.rs index a845621..d97033a 100644 --- a/benches/main.rs +++ b/benches/main.rs @@ -1,16 +1,21 @@ // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause +#[cfg(feature = "test_utilities")] use criterion::{criterion_group, criterion_main, Criterion}; +#[cfg(feature = "test_utilities")] use event_manager::utilities::subscribers::{ CounterInnerMutSubscriber, CounterSubscriber, CounterSubscriberWithData, }; +#[cfg(feature = "test_utilities")] use event_manager::{EventManager, EventSubscriber, MutEventSubscriber, SubscriberOps}; +#[cfg(feature = "test_utilities")] use std::sync::{Arc, Mutex}; // Test the performance of event manager when it manages a single subscriber type. // The performance is assessed under stress, all added subscribers have active events. +#[cfg(feature = "test_utilities")] fn run_basic_subscriber(c: &mut Criterion) { let no_of_subscribers = 200; @@ -31,6 +36,7 @@ fn run_basic_subscriber(c: &mut Criterion) { // Test the performance of event manager when the subscribers are wrapped in an Arc. // The performance is assessed under stress, all added subscribers have active events. +#[cfg(feature = "test_utilities")] fn run_arc_mutex_subscriber(c: &mut Criterion) { let no_of_subscribers = 200; @@ -52,6 +58,7 @@ fn run_arc_mutex_subscriber(c: &mut Criterion) { // Test the performance of event manager when the subscribers are wrapped in an Arc, and they // leverage inner mutability to update their internal state. // The performance is assessed under stress, all added subscribers have active events. +#[cfg(feature = "test_utilities")] fn run_subscriber_with_inner_mut(c: &mut Criterion) { let no_of_subscribers = 200; @@ -75,6 +82,7 @@ fn run_subscriber_with_inner_mut(c: &mut Criterion) { // (using CounterSubscriberWithData). // The performance is assessed under stress, all added subscribers have active events, and the // CounterSubscriberWithData subscribers have multiple active events. +#[cfg(feature = "test_utilities")] fn run_multiple_subscriber_types(c: &mut Criterion) { let no_of_subscribers = 100; @@ -102,6 +110,7 @@ fn run_multiple_subscriber_types(c: &mut Criterion) { // Test the performance of event manager when it manages a single subscriber type. // Just a few of the events are active in this test scenario. +#[cfg(feature = "test_utilities")] fn run_with_few_active_events(c: &mut Criterion) { let no_of_subscribers = 200; @@ -124,6 +133,7 @@ fn run_with_few_active_events(c: &mut Criterion) { }); } +#[cfg(feature = "test_utilities")] criterion_group! { name = benches; config = Criterion::default() @@ -133,6 +143,10 @@ criterion_group! { run_multiple_subscriber_types, run_with_few_active_events } +#[cfg(feature = "test_utilities")] criterion_main! { benches } + +#[cfg(not(feature = "test_utilities"))] +fn main() {} diff --git a/tests/basic_event_manager.rs b/tests/basic_event_manager.rs index 8930ebf..4bb3286 100644 --- a/tests/basic_event_manager.rs +++ b/tests/basic_event_manager.rs @@ -7,6 +7,8 @@ // The application has an `EventManager` and can register multiple subscribers // of type `CounterSubscriber`. +#![cfg(feature = "test_utilities")] + use std::ops::Drop; use event_manager::utilities::subscribers::CounterSubscriber; diff --git a/tests/endpoint.rs b/tests/endpoint.rs index 61a18a1..ab05052 100644 --- a/tests/endpoint.rs +++ b/tests/endpoint.rs @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause #![cfg(feature = "remote_endpoint")] +#![cfg(feature = "test_utilities")] use std::any::Any; use std::result; diff --git a/tests/multi_threaded.rs b/tests/multi_threaded.rs index 8f1d653..c5261ea 100644 --- a/tests/multi_threaded.rs +++ b/tests/multi_threaded.rs @@ -1,6 +1,8 @@ // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause +#![cfg(feature = "test_utilities")] + use std::sync::{Arc, Mutex}; use std::thread; diff --git a/tests/regressions.rs b/tests/regressions.rs index 92c83ec..fcf07ce 100644 --- a/tests/regressions.rs +++ b/tests/regressions.rs @@ -1,6 +1,8 @@ // Copyright (C) 2020 Alibaba Cloud. All rights reserved. // SPDX-License-Identifier: Apache-2.0 OR BSD-3-Clause +#![cfg(feature = "test_utilities")] + use event_manager::utilities::subscribers::CounterSubscriberWithData; use event_manager::{EventManager, SubscriberOps}; From 6424b73199a504198e219e0b911db2a115f82bdf Mon Sep 17 00:00:00 2001 From: Patrick Roy Date: Thu, 2 Oct 2025 09:23:51 +0100 Subject: [PATCH 3/3] doc: fix invalid html tags Signed-off-by: Patrick Roy --- src/utilities/subscribers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utilities/subscribers.rs b/src/utilities/subscribers.rs index e0668ce..35be1eb 100644 --- a/src/utilities/subscribers.rs +++ b/src/utilities/subscribers.rs @@ -22,7 +22,7 @@ /// 3. CounterInnerMutSubscriber: /// - a dummy subscriber that increments a counter on events /// - the subscriber makes use of inner mutability; multi-threaded applications might want to -/// use inner mutability instead of having something heavy weight (i.e. Arc). +/// use inner mutability instead of having something heavy weight (i.e. `Arc`). /// - this subscriber implement `EventSubscriber`. use std::fmt::{Display, Formatter, Result}; use std::os::unix::io::AsRawFd;