@@ -5243,7 +5243,7 @@ mod tests {
5243
5243
let _n = TimeShiftFalsePositiveNote ;
5244
5244
5245
5245
// Alice creates a group with Bob, Claire and Daisy and then removes Claire and Daisy
5246
- // (sleep() is needed as otherwise smeared time from Alice looks to Bob like messages from the future which are all set to "now" then)
5246
+ // (time shift is needed as otherwise smeared time from Alice looks to Bob like messages from the future which are all set to "now" then)
5247
5247
let alice = TestContext :: new_alice ( ) . await ;
5248
5248
5249
5249
let bob_id =
Contact :: create ( & alice
, "" , "[email protected] " ) . await ?
;
@@ -5258,17 +5258,17 @@ mod tests {
5258
5258
5259
5259
add_contact_to_chat ( & alice, alice_chat_id, claire_id) . await ?;
5260
5260
let add2 = alice. pop_sent_msg ( ) . await ;
5261
- tokio :: time :: sleep ( std :: time :: Duration :: from_millis ( 1100 ) ) . await ;
5261
+ SystemTime :: shift ( Duration :: from_millis ( 1100 ) ) ;
5262
5262
5263
5263
add_contact_to_chat ( & alice, alice_chat_id, daisy_id) . await ?;
5264
5264
let add3 = alice. pop_sent_msg ( ) . await ;
5265
- tokio :: time :: sleep ( std :: time :: Duration :: from_millis ( 1100 ) ) . await ;
5265
+ SystemTime :: shift ( Duration :: from_millis ( 1100 ) ) ;
5266
5266
5267
5267
assert_eq ! ( get_chat_contacts( & alice, alice_chat_id) . await ?. len( ) , 4 ) ;
5268
5268
5269
5269
remove_contact_from_chat ( & alice, alice_chat_id, claire_id) . await ?;
5270
5270
let remove1 = alice. pop_sent_msg ( ) . await ;
5271
- tokio :: time :: sleep ( std :: time :: Duration :: from_millis ( 1100 ) ) . await ;
5271
+ SystemTime :: shift ( Duration :: from_millis ( 1100 ) ) ;
5272
5272
5273
5273
remove_contact_from_chat ( & alice, alice_chat_id, daisy_id) . await ?;
5274
5274
let remove2 = alice. pop_sent_msg ( ) . await ;
0 commit comments