@@ -115,6 +115,7 @@ impl TestOptions {
115115 . unwrap ( ) ;
116116 self . fuzzer_with_cases (
117117 fuzz_config. runs ,
118+ fuzz_config. max_test_rejects ,
118119 Some ( Box :: new ( FileFailurePersistence :: Direct ( failure_persist_path. leak ( ) ) ) ) ,
119120 )
120121 }
@@ -128,7 +129,7 @@ impl TestOptions {
128129 /// - `test_fn` is the name of the test function declared inside the test contract.
129130 pub fn invariant_runner ( & self , contract_id : & str , test_fn : & str ) -> TestRunner {
130131 let invariant = self . invariant_config ( contract_id, test_fn) ;
131- self . fuzzer_with_cases ( invariant. runs , None )
132+ self . fuzzer_with_cases ( invariant. runs , invariant . max_assume_rejects , None )
132133 }
133134
134135 /// Returns a "fuzz" configuration setup. Parameters are used to select tight scoped fuzz
@@ -156,12 +157,13 @@ impl TestOptions {
156157 pub fn fuzzer_with_cases (
157158 & self ,
158159 cases : u32 ,
160+ max_global_rejects : u32 ,
159161 file_failure_persistence : Option < Box < dyn FailurePersistence > > ,
160162 ) -> TestRunner {
161163 let config = proptest:: test_runner:: Config {
162164 failure_persistence : file_failure_persistence,
163165 cases,
164- max_global_rejects : self . fuzz . max_test_rejects ,
166+ max_global_rejects,
165167 // Disable proptest shrink: for fuzz tests we provide single counterexample,
166168 // for invariant tests we shrink outside proptest.
167169 max_shrink_iters : 0 ,
0 commit comments