whitfin / local-cluster

Easy local cluster creation for Elixir to aid in unit testing
MIT License
223 stars 30 forks source link

Ensure all configuration merged before starts loaded applications in child nodes #14

Closed ishikawa closed 4 years ago

ishikawa commented 4 years ago

Please review df9be34 mainly, other commits are unrelated to main issue.

The current implementation copies application config (Application.put_env/4) and starts loaded applications (Application.ensure_all_started/2) simultaneously. But it can start an application before copying its configuration if other application starts it.

So in this PR, I modified code to starts applications after all configuration merged.

heydtn commented 4 years ago

I just ran into this issue, and went to put in a PR for it but found that it's already here! This issue affects any application which is relied on by another application, when that other application happens to have its config applied first.

In my case, it was an umbrella app where one of the applications relies on another under the umbrella. Loading the application causes the other one to load before its configuration is applied. Looks like one of the travis ci builds ran into a weird issue, unrelated to the PR.

whitfin commented 4 years ago

I believe this is fixed with the merge of #15, so I'm going to close it for now. Please test with the latest master and verify that it is; if not let me know and we can re-open!