diff --git a/benches/benches/bevy_tasks/iter.rs b/benches/benches/bevy_tasks/iter.rs index 4f8f75c8ed..47c2f6de14 100644 --- a/benches/benches/bevy_tasks/iter.rs +++ b/benches/benches/bevy_tasks/iter.rs @@ -61,7 +61,7 @@ fn bench_for_each(c: &mut Criterion) { b.iter(|| { v.iter_mut().for_each(|x| { busy_work(10000); - *x *= *x; + *x = x.wrapping_mul(*x); }); }); }); @@ -77,7 +77,7 @@ fn bench_for_each(c: &mut Criterion) { b.iter(|| { ParChunksMut(v.chunks_mut(100)).for_each(&pool, |x| { busy_work(10000); - *x *= *x; + *x = x.wrapping_mul(*x); }); }); }, diff --git a/tools/ci/src/commands/test.rs b/tools/ci/src/commands/test.rs index 82a64e02a0..bdb4b663d1 100644 --- a/tools/ci/src/commands/test.rs +++ b/tools/ci/src/commands/test.rs @@ -17,7 +17,9 @@ impl Prepare for TestCommand { vec![PreparedCommand::new::( cmd!( sh, - "cargo test --workspace --lib --bins --tests {no_fail_fast}" + // `--benches` runs each benchmark once in order to verify that they behave + // correctly and do not panic. + "cargo test --workspace --lib --bins --tests --benches {no_fail_fast}" ), "Please fix failing tests in output above.", )]