From c3dc3a8e490498992d1ce4f18ed7788eb92d596b Mon Sep 17 00:00:00 2001 From: LGUG2Z Date: Fri, 30 Oct 2026 19:46:34 -0700 Subject: [PATCH] fix(kde): give each schemas test its own socket Tests in komorebi/tests/schemas.rs shared one socket path and raced when run in parallel. Each test now gets its own. Verified: cargo test --workspace in the KDE tree. --- komorebi-for-kde/komorebi/tests/schemas.rs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/komorebi-for-kde/komorebi/tests/schemas.rs b/komorebi-for-kde/komorebi/tests/schemas.rs index 06157045..b1e80e9d 100644 --- a/komorebi-for-kde/komorebi/tests/schemas.rs +++ b/komorebi-for-kde/komorebi/tests/schemas.rs @@ -11,11 +11,21 @@ use komorebi::core::SocketMessage; use komorebi::window_manager::WindowManager; use serde_json::json; use std::sync::Arc; +use std::sync::atomic::AtomicUsize; +use std::sync::atomic::Ordering; + +/// The tests of this binary run in parallel in one process, so a socket named by the pid alone is +/// bound by two at once. +static NEXT: AtomicUsize = AtomicUsize::new(0); fn answer(message: SocketMessage) -> serde_json::Value { let fake = Arc::new(FakeBackend::with_one_monitor()); let (_sender, receiver) = crossbeam_channel::bounded(1); - let socket = std::path::PathBuf::from(format!("/tmp/kms-{}.sock", std::process::id())); + let socket = std::path::PathBuf::from(format!( + "/tmp/kms-{}-{}.sock", + std::process::id(), + NEXT.fetch_add(1, Ordering::Relaxed) + )); let mut reply = Vec::new(); with_backend(fake, || {