Define readiness probe to know when the new server can accept traffic

This commit is contained in:
Antonio Scandurra 2022-12-14 08:54:46 +01:00
parent 59c9a57570
commit 897506c797
4 changed files with 14 additions and 8 deletions

View file

@ -685,7 +685,7 @@ async fn test_server_restarts(
);
// The server finishes restarting, cleaning up stale connections.
server.start();
server.start().await.unwrap();
deterministic.advance_clock(CLEANUP_TIMEOUT);
assert_eq!(
room_participants(&room_a, cx_a),
@ -805,7 +805,7 @@ async fn test_server_restarts(
// The server finishes restarting, cleaning up stale connections and canceling the
// call to user D because the room has become empty.
server.start();
server.start().await.unwrap();
deterministic.advance_clock(CLEANUP_TIMEOUT);
assert!(incoming_call_d.next().await.unwrap().is_none());
}
@ -6124,7 +6124,7 @@ async fn test_random_collaboration(
log::info!("Simulating server restart");
server.teardown();
deterministic.advance_clock(RECEIVE_TIMEOUT + RECONNECT_TIMEOUT);
server.start();
server.start().await.unwrap();
deterministic.advance_clock(CLEANUP_TIMEOUT);
}
_ if !op_start_signals.is_empty() => {
@ -6324,7 +6324,7 @@ impl TestServer {
app_state.clone(),
Executor::Deterministic(deterministic.build_background()),
);
server.start();
server.start().await.unwrap();
// Advance clock to ensure the server's cleanup task is finished.
deterministic.advance_clock(CLEANUP_TIMEOUT);
Self {