whitfin / local-cluster

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

Allow skipping the loading of certain applications on remote nodes #19

Closed jeffutter closed 4 years ago

jeffutter commented 4 years ago

This fixes an issue (specifically with propcheck) where the other nodes would fail to boot. Propcheck tries to access it's context dets file at boot and having multiple instances launch at the same time causes errors like:

06:42:50.228 [info]  Application propcheck exited:
   PropCheck.App.start(:normal, []) returned an error: shutdown: failed
to start child: PropCheck.CounterStrike
    ** (EXIT) an exception was raised:
        ** (MatchError) no match of right hand side value: {:error,{:not_a_dets_file, '_build/propcheck.ctex'}}
            (propcheck 1.2.0) lib/counterstrike.ex:53:PropCheck.CounterStrike.init/1
            (stdlib 3.9.2) gen_server.erl:374: :gen_server.init_it/2
            (stdlib 3.9.2) gen_server.erl:342: :gen_server.init_it/6
            (stdlib 3.9.2) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

The solution for this is to allow local cluster to skip loading certain dependencies when booting the other nodes.

pmenhart commented 4 years ago

Note that PR #15 solves this problem. in addition, there are scenarios where the start order of applications on slave nodes has to be controlled to avoid errors.

jeffutter commented 4 years ago

@pmenhart oh yeah! Didn’t see that, that would totally cover my use case and is probably more flexible and even has tests 😝.

Hopefully that can get merged and we can close this one.

whitfin commented 4 years ago

Yes, I'm going to close this in favour of #15 - which I am intending to merge in some form once I get some clarification on another thread. Thanks for the PR though!