From 199fb59a764f971e61b75271d34904f4ed5e7525 Mon Sep 17 00:00:00 2001 From: Devin R Date: Mon, 27 Apr 2020 07:23:59 -0400 Subject: [PATCH] state_store: use tokio Mutex in state store tests --- src/state/state_store.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/state/state_store.rs b/src/state/state_store.rs index a30dfaa2..e7f5e3ac 100644 --- a/src/state/state_store.rs +++ b/src/state/state_store.rs @@ -142,12 +142,13 @@ mod test { use std::convert::TryFrom; use std::fs; + use std::future::Future; use std::path::PathBuf; use std::str::FromStr; - use std::sync::Mutex; use lazy_static::lazy_static; use mockito::{mock, Matcher}; + use tokio::sync::Mutex; use crate::identifiers::{RoomId, UserId}; use crate::{AsyncClient, AsyncClientConfig, Session, SyncSettings}; @@ -168,9 +169,9 @@ mod test { async fn run_and_cleanup(test: fn() -> Fut) where - Fut: std::future::Future, + Fut: Future, { - let _lock = MTX.lock(); + let _lock = MTX.lock().await; test().await;