Wait on RECEIVE_TIMEOUT in tests when testing disconnection

We were waiting for 3 seconds, but the timeout had changed in the meantime,
making some iterations of the tests fail.

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Antonio Scandurra 2022-05-06 16:47:08 +02:00
parent 44f37afa95
commit 9555b93bca

View file

@ -2415,7 +2415,7 @@ mod tests {
// Simulate connection loss for client B and ensure client A observes client B leaving the project.
client_b.wait_for_current_user(cx_b).await;
server.disconnect_client(client_b.current_user_id(cx_b));
cx_a.foreground().advance_clock(Duration::from_secs(3));
cx_a.foreground().advance_clock(rpc::RECEIVE_TIMEOUT);
project_a
.condition(cx_a, |p, _| p.collaborators().len() == 0)
.await;
@ -4602,7 +4602,7 @@ mod tests {
// Disconnect client B, ensuring we can still access its cached channel data.
server.forbid_connections();
server.disconnect_client(client_b.current_user_id(&cx_b));
cx_b.foreground().advance_clock(Duration::from_secs(3));
cx_b.foreground().advance_clock(rpc::RECEIVE_TIMEOUT);
while !matches!(
status_b.next().await,
Some(client::Status::ReconnectionError { .. })