mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-05 10:20:51 +00:00
Fix panics in database tests
This commit is contained in:
parent
f09d265054
commit
f1ffcb626a
1 changed files with 9 additions and 5 deletions
|
@ -1361,7 +1361,7 @@ pub mod tests {
|
|||
use super::*;
|
||||
use anyhow::anyhow;
|
||||
use collections::BTreeMap;
|
||||
use gpui::executor::Background;
|
||||
use gpui::executor::{Background, Deterministic};
|
||||
use lazy_static::lazy_static;
|
||||
use parking_lot::Mutex;
|
||||
use rand::prelude::*;
|
||||
|
@ -1376,7 +1376,7 @@ pub mod tests {
|
|||
async fn test_get_users_by_ids() {
|
||||
for test_db in [
|
||||
TestDb::postgres().await,
|
||||
TestDb::fake(Arc::new(gpui::executor::Background::new())),
|
||||
TestDb::fake(build_background_executor()),
|
||||
] {
|
||||
let db = test_db.db();
|
||||
|
||||
|
@ -1687,7 +1687,7 @@ pub mod tests {
|
|||
async fn test_recent_channel_messages() {
|
||||
for test_db in [
|
||||
TestDb::postgres().await,
|
||||
TestDb::fake(Arc::new(gpui::executor::Background::new())),
|
||||
TestDb::fake(build_background_executor()),
|
||||
] {
|
||||
let db = test_db.db();
|
||||
let user = db.create_user("user", None, false).await.unwrap();
|
||||
|
@ -1726,7 +1726,7 @@ pub mod tests {
|
|||
async fn test_channel_message_nonces() {
|
||||
for test_db in [
|
||||
TestDb::postgres().await,
|
||||
TestDb::fake(Arc::new(gpui::executor::Background::new())),
|
||||
TestDb::fake(build_background_executor()),
|
||||
] {
|
||||
let db = test_db.db();
|
||||
let user = db.create_user("user", None, false).await.unwrap();
|
||||
|
@ -1834,7 +1834,7 @@ pub mod tests {
|
|||
async fn test_add_contacts() {
|
||||
for test_db in [
|
||||
TestDb::postgres().await,
|
||||
TestDb::fake(Arc::new(gpui::executor::Background::new())),
|
||||
TestDb::fake(build_background_executor()),
|
||||
] {
|
||||
let db = test_db.db();
|
||||
|
||||
|
@ -2836,4 +2836,8 @@ pub mod tests {
|
|||
Some(self)
|
||||
}
|
||||
}
|
||||
|
||||
fn build_background_executor() -> Arc<Background> {
|
||||
Deterministic::new(0).build_background()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue