mirror of
https://github.com/chatmail/core.git
synced 2026-05-08 09:26:29 +03:00
test: Explain test_was_seen_recently false-positive and give workaround instructions (#5474)
Until the issue is fixed, keep others from running into the same issue.
This commit is contained in:
@@ -2708,7 +2708,19 @@ Hi."#;
|
|||||||
|
|
||||||
bob.recv_msg(&sent_msg).await;
|
bob.recv_msg(&sent_msg).await;
|
||||||
let contact = Contact::get_by_id(&bob, *contacts.first().unwrap()).await?;
|
let contact = Contact::get_by_id(&bob, *contacts.first().unwrap()).await?;
|
||||||
assert!(contact.was_seen_recently());
|
|
||||||
|
let green = ansi_term::Color::Green.normal();
|
||||||
|
assert!(
|
||||||
|
contact.was_seen_recently(),
|
||||||
|
"{}",
|
||||||
|
green.paint(
|
||||||
|
"\nNOTE: This test failure is probably a false-positive, caused by tests running in parallel.
|
||||||
|
The issue is that `SystemTime::shift()` (a utility function for tests) changes the time for all threads doing tests, and not only for the running test.
|
||||||
|
Until the false-positive is fixed:
|
||||||
|
- Use `cargo test -- --test-threads 1` instead of `cargo test`
|
||||||
|
- Or use `cargo nextest run` (install with `cargo install cargo-nextest --locked`)\n"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
let self_contact = Contact::get_by_id(&bob, ContactId::SELF).await?;
|
let self_contact = Contact::get_by_id(&bob, ContactId::SELF).await?;
|
||||||
assert!(!self_contact.was_seen_recently());
|
assert!(!self_contact.was_seen_recently());
|
||||||
|
|||||||
Reference in New Issue
Block a user