state_store: use tokio Mutex in state store tests

master
Devin R 2020-04-27 07:23:59 -04:00
parent 6fcf0a86f9
commit 199fb59a76
1 changed files with 4 additions and 3 deletions

View File

@ -142,12 +142,13 @@ mod test {
use std::convert::TryFrom; use std::convert::TryFrom;
use std::fs; use std::fs;
use std::future::Future;
use std::path::PathBuf; use std::path::PathBuf;
use std::str::FromStr; use std::str::FromStr;
use std::sync::Mutex;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use mockito::{mock, Matcher}; use mockito::{mock, Matcher};
use tokio::sync::Mutex;
use crate::identifiers::{RoomId, UserId}; use crate::identifiers::{RoomId, UserId};
use crate::{AsyncClient, AsyncClientConfig, Session, SyncSettings}; use crate::{AsyncClient, AsyncClientConfig, Session, SyncSettings};
@ -168,9 +169,9 @@ mod test {
async fn run_and_cleanup<Fut>(test: fn() -> Fut) async fn run_and_cleanup<Fut>(test: fn() -> Fut)
where where
Fut: std::future::Future<Output = ()>, Fut: Future<Output = ()>,
{ {
let _lock = MTX.lock(); let _lock = MTX.lock().await;
test().await; test().await;