Skip to content

Commit

Permalink
try fixing a potential test race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Sep 1, 2023
1 parent 592d7f3 commit b9036a5
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions crates/bevy_asset/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -872,6 +872,12 @@ mod tests {
app.init_asset::<CoolText>()
.register_asset_loader(CoolTextLoader);
let asset_server = app.world.resource::<AssetServer>().clone();

gate_opener.open(a_path);
gate_opener.open(b_path);
gate_opener.open(c_path);
gate_opener.open(d_path);

let handle: Handle<CoolText> = asset_server.load(a_path);
let a_id = handle.id();
{
Expand All @@ -888,10 +894,6 @@ mod tests {
}

app.world.spawn(handle);
gate_opener.open(a_path);
gate_opener.open(b_path);
gate_opener.open(c_path);
gate_opener.open(d_path);

run_app_until(&mut app, |world| {
let a_text = get::<CoolText>(world, a_id)?;
Expand Down

0 comments on commit b9036a5

Please sign in to comment.