Skip to content

Commit 720b673

Browse files
committed
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`
1 parent 26c299b commit 720b673

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

crates/bevy_transform/src/systems.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,10 @@ mod test {
318318
let mut temp = World::new();
319319
let mut app = App::new();
320320

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

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

0 commit comments

Comments
 (0)