From cc9d4303e33993eddf3572d04349fcc87aa6a06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Mon, 29 Aug 2022 10:11:29 -0400 Subject: [PATCH] fix: extend the batch timeout This mitigates #858, which shows that on Github, this timeout is nto large enough. We also suspect this may alleviate issues encountered in Sui, e.g. failures in the Sui reconfiguration end_to_end test. --- primary/src/block_waiter.rs | 2 +- primary/src/tests/block_waiter_tests.rs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/primary/src/block_waiter.rs b/primary/src/block_waiter.rs index 0e96d60da..f3a34ba41 100644 --- a/primary/src/block_waiter.rs +++ b/primary/src/block_waiter.rs @@ -30,7 +30,7 @@ use types::{ }; use Result::*; -const BATCH_RETRIEVE_TIMEOUT: Duration = Duration::from_secs(1); +const BATCH_RETRIEVE_TIMEOUT: Duration = Duration::from_secs(10); #[cfg(test)] #[path = "tests/block_waiter_tests.rs"] diff --git a/primary/src/tests/block_waiter_tests.rs b/primary/src/tests/block_waiter_tests.rs index 646626f2f..df1039f9d 100644 --- a/primary/src/tests/block_waiter_tests.rs +++ b/primary/src/tests/block_waiter_tests.rs @@ -4,6 +4,7 @@ use crate::{ block_synchronizer::{handler, handler::MockHandler}, block_waiter::{ BatchResult, BlockError, BlockErrorKind, BlockResult, GetBlockResponse, GetBlocksResponse, + BATCH_RETRIEVE_TIMEOUT, }, BlockCommand, BlockWaiter, PrimaryWorkerMessage, }; @@ -536,7 +537,8 @@ async fn test_batch_timeout() { .unwrap(); // THEN we should expect to get back the result - let timer = sleep(Duration::from_millis(5_000)); + // TODO: make sure we can run this test in less than the actual timeout range + let timer = sleep(BATCH_RETRIEVE_TIMEOUT + Duration::from_secs(2)); tokio::pin!(timer); tokio::select! {