Give more time for bob to dial Alice in CI

This commit is contained in:
Franck Royer 2021-01-22 17:33:21 +11:00
parent 07e1456b56
commit 70bf0f59f6
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
2 changed files with 11 additions and 1 deletions

View File

@ -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.

View File

@ -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<Duration> = Lazy::new(|| Duration::from_secs(10 * 60));
pub static BOB_TIME_TO_ACT: Lazy<Duration> = 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;