Skip to content

Commit

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

# Objective

- Fix bevyengine#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 authored and ItsDoot committed Feb 1, 2023
1 parent 15a456a commit d00f790
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 d00f790

Please sign in to comment.