eigr / massa

A Stateful Serverless framework on the BEAM VM
https://eigr.io
Apache License 2.0
54 stars 5 forks source link

Running mix test is running into an error during startup #120

Closed zblanco closed 2 years ago

zblanco commented 2 years ago

Running mix test with a fresh pull of massa on OTP 24 and OTP 23 produces an error like the following:

OTP 24

ASDF .tool-versions

erlang 24.2.1
elixir 1.13.2-otp-24

Error

** (Mix) Could not start application massa_proxy: exited in: MassaProxy.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (ArgumentError) errors were found at the given arguments:

  * 1st argument: the node name is not part of a distributed system

            :erlang.set_cookie(:nonode@nohost, :massa_proxy)
            (massa_proxy 0.1.0) lib/massa_proxy/util.ex:54: MassaProxy.Util.setup/0
            (massa_proxy 0.1.0) lib/massa_proxy.ex:10: MassaProxy.start/2
            (kernel 8.2) application_master.erl:293: :application_master.start_it_old/4

OTP 23

ASDF .tool-versions

erlang 23.3.4.11
elixir 1.13.3-otp-23

Error

** (Mix) Could not start application massa_proxy: exited in: MassaProxy.start(:normal, [])
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in :erlang.set_cookie/2
            :erlang.set_cookie(:nonode@nohost, :"6eycE1E/S341t4Bcto262ffyFWklCWHQIKloJDJYR7Y=")
            (massa_proxy 0.1.0) lib/massa_proxy/util.ex:54: MassaProxy.Util.setup/0
            (massa_proxy 0.1.0) lib/massa_proxy.ex:10: MassaProxy.start/2
            (kernel 7.3.1.4) application_master.erl:277: :application_master.start_it_old/4

May relate to https://github.com/erlang/otp/issues/5402 which seems to have a fix in main pending release: https://github.com/erlang/otp/pull/5670

sleipnir commented 2 years ago

Hi @zblanco, thanks for opening the ticket. I will investigate how we can best resolve this. But from what I understand what happens is that Massa expects a valid Node name when starting and this doesn't happen in our tests currently. How I run the tests is to run the tests as follows (obviously I know this is not the best way, just a workaround):

iex --name massa-001@127.0.0.1 -S mix test
sleipnir commented 2 years ago

@zblanco I made a definite fix, could try. Feel free to reopen this issue or open a new one if necessary.