chore: add constant for the timeout number

This commit is contained in:
vinhtc27
2025-08-14 15:49:23 +07:00
parent 40e9e91684
commit 737d443c6f

View File

@@ -32,6 +32,9 @@ mod proof_service_tests {
const TX_HASH_1: [u8; 32] = [0x011; 32];
const TX_HASH_1_2: [u8; 32] = [0x12; 32];
// Set to 10 seconds as 5 seconds can cause failures on Mac M1 machines.
const PROOF_VERIFY_TEST_TIMEOUT: u64 = 10;
#[derive(thiserror::Error, Debug)]
enum AppErrorExt {
#[error("AppError: {0}")]
@@ -88,7 +91,7 @@ mod proof_service_tests {
debug!("Starting broadcast receiver...");
tokio::time::sleep(std::time::Duration::from_secs(1)).await;
let res = tokio::time::timeout(
std::time::Duration::from_secs(10),
std::time::Duration::from_secs(PROOF_VERIFY_TEST_TIMEOUT),
broadcast_receiver.recv(),
)
.await
@@ -193,7 +196,7 @@ mod proof_service_tests {
loop {
let res = tokio::time::timeout(
std::time::Duration::from_secs(10),
std::time::Duration::from_secs(PROOF_VERIFY_TEST_TIMEOUT),
broadcast_receiver.recv(),
)
.await