diff --git a/crates/buzz-db/src/store/operator_listener.rs b/crates/buzz-db/src/store/operator_listener.rs index e04d3e82d5..3d92609462 100644 --- a/crates/buzz-db/src/store/operator_listener.rs +++ b/crates/buzz-db/src/store/operator_listener.rs @@ -740,7 +740,7 @@ mod postgres_tests { register_pubkeys( &pool, listener.public_key().as_bytes(), - &[target_bytes.clone()], + std::slice::from_ref(&target_bytes), ) .await .expect("register target"); diff --git a/crates/buzz-relay/src/operator_listener.rs b/crates/buzz-relay/src/operator_listener.rs index 52da658ebc..c26ff66fc3 100644 --- a/crates/buzz-relay/src/operator_listener.rs +++ b/crates/buzz-relay/src/operator_listener.rs @@ -315,7 +315,7 @@ async fn retry_or_fail( #[cfg(test)] mod tests { - use std::sync::{Arc, Mutex, MutexGuard}; + use std::sync::{Arc, Mutex}; use buzz_core::CommunityId; use chrono::Utc; @@ -338,13 +338,11 @@ mod tests { body: Vec, } - static TEST_LOCK: Mutex<()> = Mutex::new(()); + static TEST_LOCK: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(()); static MIGRATIONS: tokio::sync::OnceCell<()> = tokio::sync::OnceCell::const_new(); - fn test_lock() -> MutexGuard<'static, ()> { - TEST_LOCK - .lock() - .unwrap_or_else(|poisoned| poisoned.into_inner()) + async fn test_lock() -> tokio::sync::MutexGuard<'static, ()> { + TEST_LOCK.lock().await } #[async_trait::async_trait] @@ -448,7 +446,7 @@ mod tests { #[tokio::test] #[ignore = "requires Postgres"] async fn matcher_iteration_expands_triggered_mention() { - let _test_lock = test_lock(); + let _test_lock = test_lock().await; let (pool, state) = setup().await; let community = make_community(&pool).await; let listener = Keys::generate(); @@ -493,7 +491,7 @@ mod tests { #[tokio::test] #[ignore = "requires Postgres"] async fn delivery_worker_posts_signed_notification_and_completes() { - let _test_lock = test_lock(); + let _test_lock = test_lock().await; let (pool, mut state) = setup().await; let listener = Keys::generate(); let target = Keys::generate(); @@ -549,7 +547,7 @@ mod tests { #[tokio::test] #[ignore = "requires Postgres"] async fn delivery_worker_persists_retry_after_failure() { - let _test_lock = test_lock(); + let _test_lock = test_lock().await; let (pool, mut state) = setup().await; let listener = Keys::generate(); let target = Keys::generate();