Skip to content

Commit 98a05be

Browse files
committed
fix: logs, j1
1 parent 073cf85 commit 98a05be

File tree

2 files changed

+10
-2
lines changed
  • crates

2 files changed

+10
-2
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,11 +344,16 @@ impl FuzzedExecutor {
344344
result.success = true;
345345
result.traces = last_run_worker.traces.last().cloned();
346346
result.breakpoints = last_run_worker.breakpoints.clone();
347+
if !self.config.show_logs {
348+
result.logs = last_run_worker.logs.clone();
349+
}
347350
}
348351

349352
for mut worker in workers {
350353
result.gas_by_case.append(&mut worker.gas_by_case);
351-
result.logs.append(&mut worker.logs);
354+
if self.config.show_logs {
355+
result.logs.append(&mut worker.logs);
356+
}
352357
result.gas_report_traces.extend(worker.traces.into_iter().map(|t| t.arena));
353358
HitMaps::merge_opt(&mut result.line_coverage, worker.coverage);
354359
result.deprecated_cheatcodes.extend(worker.deprecated_cheatcodes);
@@ -407,6 +412,7 @@ impl FuzzedExecutor {
407412
std::cmp::max(1, self.config.gas_report_samples / num_workers as u32);
408413

409414
let worker_runs = self.runs_per_worker(worker_id);
415+
debug!(worker_runs);
410416

411417
let mut runner_config = self.runner.config().clone();
412418
runner_config.cases = worker_runs;
@@ -610,6 +616,8 @@ impl FuzzedExecutor {
610616
let n = self.num_workers() as u32;
611617
let runs = total_runs / n;
612618
let remainder = total_runs % n;
619+
// Distribute the remainder evenly among the first `remainder` workers,
620+
// assuming `worker_id` is in `0..n`.
613621
if worker_id < remainder { runs + 1 } else { runs }
614622
}
615623
}

crates/forge/tests/cli/test_cmd/fuzz.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ Suite result: FAILED. 0 passed; 1 failed; 0 skipped; [ELAPSED]
525525
assert.stdout_eq(expected.clone());
526526
};
527527

528-
cmd.arg("test");
528+
cmd.args(["test", "-j1"]);
529529

530530
// Run several times, asserting that the failure persists and is the same.
531531
for _ in 0..3 {

0 commit comments

Comments
 (0)