fix test_random_generator_collision with tokio::sync::Mutex
use super::*;
use defer::defer;
-use std::sync::{Arc, Mutex};
+use std::sync::Arc;
+use tokio::sync::Mutex;
use util::Error;
use waitgroup::WaitGroup;
@@ -53,14 +54,13 @@ async fn test_random_generator_collision() -> Result<(), Error> {
generate_ufrag()
};
- if let Ok(mut r) = rs.lock() {
+ let mut r = rs.lock().await;
r.push(s);
- }
});
}
wg.wait().await;
- if let Ok(rs) = rands.lock() {
+ let rs = rands.lock().await;
assert_eq!(rs.len(), N, "{} Failed to generate randoms", name);
for i in 0..N {
@@ -72,7 +72,6 @@ async fn test_random_generator_collision() -> Result<(), Error> {
);
}
}
- };
}
}
