Skip to content

Commit

Permalink
flaky test: put panicking system in a single threaded stage (#6172)
Browse files Browse the repository at this point in the history
# Objective

- Fix #5285 

## Solution

- Put the panicking system in a single threaded stage during the test
- This way only the main thread will panic, which is handled by `cargo test`
  • Loading branch information
mockersf committed Oct 5, 2022
1 parent 26c299b commit 720b673
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bevy_transform/src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,10 @@ mod test {
let mut temp = World::new();
let mut app = App::new();

app.add_system(transform_propagate_system);
// Adding the system in a single threaded stage. As the system will panic, this will
// only bring down the current test thread.
app.add_stage("single", SystemStage::single_threaded())
.add_system_to_stage("single", transform_propagate_system);

fn setup_world(world: &mut World) -> (Entity, Entity) {
let mut grandchild = Entity::from_raw(0);
Expand Down

0 comments on commit 720b673

Please sign in to comment.