1
votes

I'm following this tutorial and I've double and triple checked the code compared to the tutorial and their GH repo and I can't figure out why I'm getting this error when running mix test

I'm pretty green when it comes to Elixir so I'm not terribly good at debugging yet so please excuse me if this is super simple

board_server.ex Gist

game_of_life.ex Gist

And my test file

defmodule GameOfLife.BoardServerTest do
  use ExUnit.Case
  doctest GameOfLife.BoardServer
end

The error I'm getting is:

test/board_server_test.exs:3
 ** (exit) exited in: GenServer.call({:global, GameOfLife.BoardServer}, {:start_game, 1000}, 5000)
     ** (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
 stacktrace:
   (elixir) lib/gen_server.ex:729: GenServer.call/3
   (for doctest at) lib/game_of_life/board_server.ex:121: (test)

Thank you in advance

1
Have you put the right module name in the mod key in mix.exs's application/0?Dogbert
In other words, you should post your mix.exs file.Steve Pallen

1 Answers

0
votes

This error states that the server is not started. You can start it with the GameOfLife.BoardServer.start_link function.

In short, you should start your server with GenServer#start or GenServer#start_link functions.

GenServer docs