mirror of
https://github.com/chatmail/core.git
synced 2026-05-21 07:46:31 +03:00
Don't use opt_level=1, instead box futures
This commit is contained in:
@@ -9,7 +9,6 @@ rust-version = "1.56"
|
|||||||
[profile.dev]
|
[profile.dev]
|
||||||
debug = 0
|
debug = 0
|
||||||
panic = 'abort'
|
panic = 'abort'
|
||||||
opt-level = 1
|
|
||||||
|
|
||||||
[profile.release]
|
[profile.release]
|
||||||
lto = true
|
lto = true
|
||||||
|
|||||||
@@ -695,8 +695,9 @@ mod tests {
|
|||||||
use crate::test_utils::{TestContext, TestContextManager};
|
use crate::test_utils::{TestContext, TestContextManager};
|
||||||
use crate::tools::EmailAddress;
|
use crate::tools::EmailAddress;
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[test]
|
||||||
async fn test_setup_contact() {
|
fn test_setup_contact() {
|
||||||
|
let body = Box::pin(async {
|
||||||
let mut tcm = TestContextManager::new();
|
let mut tcm = TestContextManager::new();
|
||||||
let alice = tcm.alice().await;
|
let alice = tcm.alice().await;
|
||||||
let bob = tcm.bob().await;
|
let bob = tcm.bob().await;
|
||||||
@@ -903,6 +904,13 @@ mod tests {
|
|||||||
msg.get_header(HeaderDef::SecureJoin).unwrap(),
|
msg.get_header(HeaderDef::SecureJoin).unwrap(),
|
||||||
"vc-contact-confirm-received"
|
"vc-contact-confirm-received"
|
||||||
);
|
);
|
||||||
|
});
|
||||||
|
return tokio::runtime::Builder::new_multi_thread()
|
||||||
|
.worker_threads(2usize)
|
||||||
|
.enable_all()
|
||||||
|
.build()
|
||||||
|
.expect("Failed building the Runtime")
|
||||||
|
.block_on(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
@@ -1068,8 +1076,9 @@ mod tests {
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[test]
|
||||||
async fn test_secure_join() -> Result<()> {
|
fn test_secure_join() -> Result<()> {
|
||||||
|
let body = Box::pin(async {
|
||||||
let mut tcm = TestContextManager::new();
|
let mut tcm = TestContextManager::new();
|
||||||
let alice = tcm.alice().await;
|
let alice = tcm.alice().await;
|
||||||
let bob = tcm.bob().await;
|
let bob = tcm.bob().await;
|
||||||
@@ -1079,7 +1088,8 @@ mod tests {
|
|||||||
assert_eq!(Chatlist::try_load(&bob, 0, None, None).await?.len(), 0);
|
assert_eq!(Chatlist::try_load(&bob, 0, None, None).await?.len(), 0);
|
||||||
|
|
||||||
let alice_chatid =
|
let alice_chatid =
|
||||||
chat::create_group_chat(&alice.ctx, ProtectionStatus::Protected, "the chat").await?;
|
chat::create_group_chat(&alice.ctx, ProtectionStatus::Protected, "the chat")
|
||||||
|
.await?;
|
||||||
|
|
||||||
// Step 1: Generate QR-code, secure-join implied by chatid
|
// Step 1: Generate QR-code, secure-join implied by chatid
|
||||||
let qr = get_securejoin_qr(&alice.ctx, Some(alice_chatid))
|
let qr = get_securejoin_qr(&alice.ctx, Some(alice_chatid))
|
||||||
@@ -1293,6 +1303,13 @@ mod tests {
|
|||||||
assert_eq!(Chatlist::try_load(&bob, 0, None, None).await?.len(), 2);
|
assert_eq!(Chatlist::try_load(&bob, 0, None, None).await?.len(), 2);
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
});
|
||||||
|
return tokio::runtime::Builder::new_multi_thread()
|
||||||
|
.worker_threads(2usize)
|
||||||
|
.enable_all()
|
||||||
|
.build()
|
||||||
|
.expect("Failed building the Runtime")
|
||||||
|
.block_on(body);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||||
|
|||||||
Reference in New Issue
Block a user