From 809be73e96ca8c4e137787999b14f8d4d97fb35a Mon Sep 17 00:00:00 2001 From: selikhov Date: Sat, 3 Oct 2026 11:57:32 +0300 Subject: [PATCH] voelin-platform: don't show a test notification on a developer's desktop notify_returns checks that a notification fails cleanly without a notification service, but where a session bus and a notification daemon exist it sent a real urgent "Poke: from a test" notification on every test run. Skip it there, as the portal capture test already does. Co-Authored-By: Claude Opus 5.5 --- crates/voelin-platform/src/notify.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/voelin-platform/src/notify.rs b/crates/voelin-platform/src/notify.rs index 15eec0b..12882f8 100644 --- a/crates/voelin-platform/src/notify.rs +++ b/crates/voelin-platform/src/notify.rs @@ -66,8 +66,16 @@ mod tests { use super::*; /// Without a notification service this must fail, not hang or panic. + /// Skipped where a session bus exists: on a desktop the notification + /// would really show. #[tokio::test] async fn notify_returns() { + let runtime_bus = std::env::var_os("XDG_RUNTIME_DIR") + .is_some_and(|d| std::path::Path::new(&d).join("bus").exists()); + if std::env::var_os("DBUS_SESSION_BUS_ADDRESS").is_some() || runtime_bus { + eprintln!("skipped: a D-Bus session bus is configured"); + return; + } let n = Notification { urgent: true, ..Notification::new("Poke", "from a test") }; let result = tokio::time::timeout(Duration::from_secs(10), notify(&n)).await; assert!(result.is_ok(), "notify hung");