Skip to content

Commit ad54afd

Browse files
authored
fix(forge): update progress on rejected fuzz runs (#12243)
fix: update progress on rejected runs
1 parent 479a810 commit ad54afd

File tree

1 file changed

+13
-6
lines changed
  • crates/evm/evm/src/executors/fuzz

1 file changed

+13
-6
lines changed

crates/evm/evm/src/executors/fuzz/mod.rs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -227,12 +227,19 @@ impl FuzzedExecutor {
227227
// Discard run and apply max rejects if configured. Saturate to handle
228228
// the case of replayed failure, which doesn't count as a run.
229229
test_data.runs = test_data.runs.saturating_sub(1);
230-
if self.config.max_test_rejects > 0 {
231-
test_data.rejects += 1;
232-
if test_data.rejects >= self.config.max_test_rejects {
233-
test_data.failure = Some(err);
234-
break 'stop;
235-
}
230+
test_data.rejects += 1;
231+
232+
// Update progress bar to reflect rejected runs.
233+
if let Some(progress) = progress {
234+
progress.set_message(format!("([{}] rejected)", test_data.rejects));
235+
progress.dec(1);
236+
}
237+
238+
if self.config.max_test_rejects > 0
239+
&& test_data.rejects >= self.config.max_test_rejects
240+
{
241+
test_data.failure = Some(err);
242+
break 'stop;
236243
}
237244
}
238245
}

0 commit comments

Comments
 (0)