flaky test: put panicking system in a single threaded stage (#6172)

# 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`
This commit is contained in:
François 2022-10-05 16:34:55 +00:00
parent 26c299bd2a
commit 720b67396f

View File

@ -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);