diff --git a/rust/sea_battle_backend/src/test/bot_random_play.rs b/rust/sea_battle_backend/src/test/bot_random_play.rs index 03beaab..c090ae3 100644 --- a/rust/sea_battle_backend/src/test/bot_random_play.rs +++ b/rust/sea_battle_backend/src/test/bot_random_play.rs @@ -10,6 +10,7 @@ use crate::test::bot_client::ClientEndResult; use crate::test::play_utils::check_no_replay_on_hit; use crate::test::TestPort; use crate::utils::network_utils::wait_for_port; +use crate::utils::time_utils::time; #[tokio::test] async fn invalid_port() { @@ -214,6 +215,8 @@ async fn check_fire_time_out() { task::spawn_local(start_server(Args::for_test(TestPort::RandomCheckTimeout))); wait_for_port(TestPort::RandomCheckTimeout.port()).await; + let start = time(); + let mut did_skip_one = false; let res = bot_client::BotClient::new(TestPort::RandomCheckTimeout.as_url()) .with_rules( @@ -228,7 +231,10 @@ async fn check_fire_time_out() { .run_client() .await .unwrap(); + assert!(matches!(res, ClientEndResult::Finished { .. })); + + assert!(time() - start >= MIN_STRIKE_TIMEOUT); }) .await; }