From d49c11ee70d66b995ef4e30585a21599eb7d2299 Mon Sep 17 00:00:00 2001 From: teor Date: Wed, 5 Aug 2020 18:12:34 +1000 Subject: [PATCH] fix: Allow PROPTEST_CASES to override the lower block case default --- zebra-chain/src/block/tests.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/zebra-chain/src/block/tests.rs b/zebra-chain/src/block/tests.rs index eb6fd931..df708aee 100644 --- a/zebra-chain/src/block/tests.rs +++ b/zebra-chain/src/block/tests.rs @@ -15,6 +15,7 @@ use proptest::{ prelude::*, test_runner::Config, }; +use std::env; use std::io::{Cursor, ErrorKind, Write}; impl Arbitrary for BlockHeader { @@ -214,8 +215,12 @@ proptest! { } proptest! { - // The block roundtrip test can be really slow - #![proptest_config(Config::with_cases(16))] + // The block roundtrip test can be really slow, so we use fewer cases by + // default. Set the PROPTEST_CASES env var to override this default. + #![proptest_config(Config::with_cases(env::var("PROPTEST_CASES") + .ok() + .and_then(|v| v.parse().ok()) + .unwrap_or(16)))] #[test] fn block_roundtrip(block in any::()) {