From a7ae0807acf3719c350c9c9ce2033a41b5d07035 Mon Sep 17 00:00:00 2001 From: Oliver Maskery Date: Tue, 24 Dec 2024 17:18:03 +0000 Subject: [PATCH] Fix panic in benches caused by missing resources (#16956) # Objective - To fix the benches panicking on `main` ## Solution - It appears that systems requiring access to a non-existing `Res` now causes a panic - Some of the benches run systems that access resources that have not been inserted into the world - I have made it so that those resources are inserted into the world ## Testing - I ran all the ecs benches and they all run without panicking Co-authored-by: Oliver Maskery --- benches/benches/bevy_ecs/param/dyn_param.rs | 2 ++ benches/benches/bevy_ecs/param/param_set.rs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/benches/benches/bevy_ecs/param/dyn_param.rs b/benches/benches/bevy_ecs/param/dyn_param.rs index 33de52bf13560..b88370272eb1f 100644 --- a/benches/benches/bevy_ecs/param/dyn_param.rs +++ b/benches/benches/bevy_ecs/param/dyn_param.rs @@ -14,6 +14,8 @@ pub fn dyn_param(criterion: &mut Criterion) { #[derive(Resource)] struct R; + world.insert_resource(R); + let mut schedule = Schedule::default(); let system = ( DynParamBuilder::new::>(ParamBuilder), diff --git a/benches/benches/bevy_ecs/param/param_set.rs b/benches/benches/bevy_ecs/param/param_set.rs index 0521561b6b804..3f967a8de174e 100644 --- a/benches/benches/bevy_ecs/param/param_set.rs +++ b/benches/benches/bevy_ecs/param/param_set.rs @@ -11,6 +11,8 @@ pub fn param_set(criterion: &mut Criterion) { #[derive(Resource)] struct R; + world.insert_resource(R); + let mut schedule = Schedule::default(); schedule.add_systems( |_: ParamSet<(