From 3bbd385ee2d1dff10f45d7ee1b7cab20b2fc1748 Mon Sep 17 00:00:00 2001 From: Kodi Craft Date: Fri, 21 Jun 2024 12:07:56 +0200 Subject: [PATCH] Putting a delay there is useless actually --- tests/mod.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/tests/mod.rs b/tests/mod.rs index 2406993..d99e968 100644 --- a/tests/mod.rs +++ b/tests/mod.rs @@ -45,19 +45,12 @@ async fn main() { server.abort(); } -// Simulates a network delay or some other kind of slow-down in the communication. -// We don't want it to be too big not to slow down tests unnecessarily. -async fn random_sleep() { - tokio::time::sleep(std::time::Duration::from_millis(rand::random::() % 20)).await; -} - async fn server_loop( mut qrx: Receiver<(u64, __TestProtocolQuestion)>, atx: Sender<(u64, __TestProtocolAnswer)>, ) { loop { if let Some((nonce, q)) = qrx.recv().await { - random_sleep().await; match q { __TestProtocolQuestion::addition((a, b)) => { atx.send((nonce, __TestProtocolAnswer::addition(a + b)))