Skip to content

Commit

Permalink
Fix panic in benches caused by missing resources (#16956)
Browse files Browse the repository at this point in the history
# 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 <[email protected]>
  • Loading branch information
omaskery and Oliver Maskery authored Dec 24, 2024
1 parent f966534 commit a7ae080
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions benches/benches/bevy_ecs/param/dyn_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<Res<R>>(ParamBuilder),
Expand Down
2 changes: 2 additions & 0 deletions benches/benches/bevy_ecs/param/param_set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<(
Expand Down

0 comments on commit a7ae080

Please sign in to comment.