From 70bf0f59f65d5a4d9caaec8b9a27e45abeb9b42e Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Fri, 22 Jan 2021 17:33:21 +1100 Subject: [PATCH] Give more time for bob to dial Alice in CI --- .github/workflows/ci.yml | 1 + swap/src/config.rs | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3ec7abab..ad9f0c4d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,6 +105,7 @@ jobs: if: (!matrix.skip_tests) run: cargo test -j2 --workspace --all-features env: + BOB_TIME_TO_ACT_MIN_TEST: 30 MONERO_ADDITIONAL_SLEEP_PERIOD: 60000 RUST_MIN_STACK: 16777216 # 16 MB. Default is 8MB. This is fine as in tests we start 2 programs: Alice and Bob. diff --git a/swap/src/config.rs b/swap/src/config.rs index b0ea5d4f..d0291645 100644 --- a/swap/src/config.rs +++ b/swap/src/config.rs @@ -94,10 +94,19 @@ mod testnet { mod regtest { use super::*; + use std::{env, str::FromStr}; // In test, we set a shorter time to fail fast but not so short that it makes // the test fail - pub static BOB_TIME_TO_ACT: Lazy = Lazy::new(|| Duration::from_secs(10 * 60)); + pub static BOB_TIME_TO_ACT: Lazy = Lazy::new(|| { + let min = match env::var("BOB_TIME_TO_ACT_MIN_TEST") { + Ok(min) => u64::from_str(&min) + .expect("env BOB_TIME_TO_ACT_MIN_TEST must be an unsigned integer"), + Err(_) => 1, + }; + + Duration::from_secs(min * 60) + }); pub static BITCOIN_FINALITY_CONFIRMATIONS: u32 = 1;