Skip to content

Undeterministic startup vs. main schedule execution during unit tests #8718

Closed Answered by rohel01
rohel01 asked this question in Q&A
Discussion options

You must be logged in to vote

I found the issue, this is not a Bevy bug.

In my production unit test, I failed to add the proper dependencies between my startup systems so their execution order was nondeterministic. Using the above example to illustrate the issue, sometimes fwk::initialize_registry_systems would run before cmd::register_systems. So, the former would try to initialize all systems in the register, but it does not contain any yet...

This does not happen in production and in the example because I added initialize_cmd_system_register to the StartupSet::PostStartup set. When writing the unit test, I forgot to do it.

Sorry for the noise

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@alice-i-cecile
Comment options

@rohel01
Comment options

@rohel01
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by rohel01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants