integration tests: make test_event_with_context wait for as long as it claims

The previous linear backoff would retry overall 10 times the value, and
10x30 == 300ms, not 3 seconds.
This commit is contained in:
Benjamin Bouvier
2024-07-16 13:14:56 +02:00
parent 1f1310c797
commit 55d0a3cdb8

View File

@@ -60,15 +60,15 @@ async fn test_event_with_context() -> Result<()> {
// Bob joins it.
let mut bob_joined = false;
for i in 1..=4 {
for i in 1..=5 {
if let Some(room) = bob.get_room(&room_id) {
room.join().await?;
bob_joined = true;
break;
}
sleep(Duration::from_millis(30 * i)).await;
sleep(Duration::from_millis(500 * i)).await;
}
anyhow::ensure!(bob_joined, "bob couldn't join after 3 seconds");
anyhow::ensure!(bob_joined, "bob couldn't join after ~8 seconds");
assert_eq!(alice_room.state(), RoomState::Joined);