Content-Length: 223666 | pFad | http://github.com/f34nk/modest_ex/issues/17

D4 Unable to use in two simultaneous instances · Issue #17 · f34nk/modest_ex · GitHub
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use in two simultaneous instances #17

Open
backspace opened this issue Jun 29, 2019 · 3 comments
Open

Unable to use in two simultaneous instances #17

backspace opened this issue Jun 29, 2019 · 3 comments

Comments

@backspace
Copy link

Hey, thanks for this library, I chose to start a new application in Elixir without ensuring something like this existed, so I’m glad it does!

I feel like a comparative neophyte when it comes to Elixir/Erlang and Phoenix so it may be that I’m missing something obvious, but I’ve found that I can’t use modest_ex when it’s already running in another process. For instance, if I’m running mix phx.server so I can interact with the live application, when I run mix test to execute the tests, I get this error:

** (Mix) Could not start application modest_ex: exited in: ModestEx.Safe.start(:normal, [])
    ** (EXIT) exited in: :gen_server.call(:boot_server, {:add, {{255, 255, 255, 255}, {127, 0, 0, 1}}})
        ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started

If I kill the server process and run mix test, then the tests pass with no problem.

I’ve tried a few things:

  • runtime: false in mix.exs#deps
  • :modest_ex in mix.exs#application extra_applications
  • Application.ensure_all_started(:modest_ex) in test_helper.exs

I’m running this with Elixir 1.9.0 and Phoenix 1.4.7.

@backspace
Copy link
Author

backspace commented Jun 29, 2019

hmm I’m even finding now that I can’t have more than one test that exercises ModestEx, as I get messages like this error:

21:49:11.600 [error] GenServer ModestEx.Safe.Cnode terminating
** (ArgumentError) all arguments for System.cmd/3 must be binaries
    (elixir) lib/system.ex:782: System.cmd/3
    (nodex) lib/nodex/cnode.ex:132: Nodex.Cnode.terminate/2
    (stdlib) gen_server.erl:673: :gen_server.try_terminate/3
    (stdlib) gen_server.erl:858: :gen_server.terminate/10
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Last message: {:nodedown, :"e5a463a0@127.0.0.1"}

ETA actually, I was incorrect, the second test was just producing a ModestEx error 😬

@f34nk
Copy link
Owner

f34nk commented Jun 30, 2019

Hey Buck, looking at the error message this is a nodex issue. Are you able to provide an example to demonstrate this? I would need some time to look at this. Maybe also ask this in the forum. I remember there is a nodex thread here.
Frank

@backspace
Copy link
Author

Thanks for the response!

I made this repository to reproduce the problem. In e326b53, I added the modest_ex dependency and a simple test to exercise it, and the tests passed.

Then in 418d51c I added a before_script on Travis CI to start the Phoenix server with mix phx.server &, so it’s running in the background. Then the tests don’t run.

However, the error is different than the one I see locally and there are some CMake errors earlier in the log, so it may be that this isn’t a true reproduction. But when I have mix phx.server running locally and run mix test in another terminal, I do get a similar error:

** (Mix) Could not start application modest_ex: exited in: ModestEx.Safe.start(:normal, [])
    ** (EXIT) exited in: :gen_server.call(:boot_server, {:add, {{255, 255, 255, 255}, {127, 0, 0, 1}}})
        ** (EXIT) no process: the process is not alive or there's no process currently associated with the given name, possibly because its application isn't started

I’m experiencing this on macOS 10.14.4. It’s not a disaster as I’ve just been killing the server when I want to run the tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/f34nk/modest_ex/issues/17

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy