File tree Expand file tree Collapse file tree 1 file changed +20
-6
lines changed
testing/matrix-sdk-integration-testing/src/tests Expand file tree Collapse file tree 1 file changed +20
-6
lines changed Original file line number Diff line number Diff line change 1- use std:: sync:: { Arc , Mutex } ;
1+ use std:: {
2+ sync:: { Arc , Mutex } ,
3+ time:: Duration ,
4+ } ;
25
36use anyhow:: Result ;
47use assert_matches:: assert_matches;
@@ -27,6 +30,7 @@ use matrix_sdk::{
2730 EventContentFromType , GlobalAccountDataEventType , OriginalSyncMessageLikeEvent ,
2831 } ,
2932 } ,
33+ timeout:: timeout,
3034 Client ,
3135} ;
3236use serde_json:: value:: to_raw_value;
@@ -1064,12 +1068,22 @@ async fn test_recovery_disabling_deletes_secret_storage_secrets() -> Result<()>
10641068 }
10651069
10661070 debug ! ( "Checking that the info about the default key has been deleted" ) ;
1071+
10671072 let event_type = GlobalAccountDataEventType :: SecretStorageKey ( key_id) ;
1068- let content = client
1069- . account ( )
1070- . fetch_account_data ( event_type. clone ( ) )
1071- . await ?
1072- . expect ( "The key event should be available on the server" ) ;
1073+
1074+ let get_key_content = async {
1075+ loop {
1076+ if let Ok ( Some ( content) ) = client. account ( ) . fetch_account_data ( event_type. clone ( ) ) . await
1077+ {
1078+ return Some ( content) ;
1079+ }
1080+ }
1081+ } ;
1082+
1083+ let content = timeout ( get_key_content, Duration :: from_millis ( 500 ) )
1084+ . await
1085+ . expect ( "We should be able to fetch the key content" )
1086+ . unwrap ( ) ;
10731087
10741088 SecretStorageKeyEventContent :: from_parts (
10751089 & event_type. to_string ( ) ,
You can’t perform that action at this time.
0 commit comments