From 9bdd2ae977b79a9450ee5c3e40d27ac84e7c769b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 15 Dec 2025 12:11:29 +0100 Subject: [PATCH] test: Ensure that the test_enabling_backups_retries_decryption test times out --- .../src/tests/timeline.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/testing/matrix-sdk-integration-testing/src/tests/timeline.rs b/testing/matrix-sdk-integration-testing/src/tests/timeline.rs index 008ae81ff..7582733cf 100644 --- a/testing/matrix-sdk-integration-testing/src/tests/timeline.rs +++ b/testing/matrix-sdk-integration-testing/src/tests/timeline.rs @@ -483,11 +483,17 @@ async fn test_enabling_backups_retries_decryption() { pin_mut!(room_key_stream); // Wait for the room key to arrive before continuing. - if let Some(update) = room_key_stream.next().await { - let _update = update.expect( + let wait_for_room_key = async { + if let Some(update) = room_key_stream.next().await { + let _update = update.expect( "We should not miss the update since we're only broadcasting a small amount of updates", ); - } + } + }; + + timeout(Duration::from_secs(5), wait_for_room_key) + .await + .expect("We should have downloaded the room key from the backup"); // Alright, we should now receive an update that the event had been decrypted. let _vector_diff = timeout(Duration::from_secs(5), stream.next()).await.unwrap().unwrap();