samsondav / rihanna

Rihanna is a high performance postgres-backed job queue for Elixir
MIT License
439 stars 49 forks source link

erros when running tests #31

Closed angelo-moreira closed 5 years ago

angelo-moreira commented 6 years ago

I am trying to run the tests on Ubuntu 18.04 (Bionic) with

# elixir -v
Erlang/OTP 21 [erts-10.0] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1]

Elixir 1.7.1 (compiled with Erlang/OTP 21)

The tests run successfully (it seems) but I am getting a lot of errors, output below:

# mix test 
.......
10:47:58.614 [error] Task #PID<0.255.0> started from #PID<0.253.0> terminating
** (RuntimeError) Kaboom!
    (rihanna) test/support/mocks.ex:75: Rihanna.Mocks.BadMFAMock.perform/1
    (rihanna) lib/rihanna/job_dispatcher.ex:134: anonymous fn/1 in Rihanna.JobDispatcher.spawn_supervised_task/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<2.72278995/0 in Rihanna.JobDispatcher.spawn_supervised_task/1>
    Args: []
....
10:47:59.056 [error] Task #PID<0.271.0> started from #PID<0.269.0> terminating
** (UndefinedFunctionError) function Nope.broken/1 is undefined (module Nope is not available)
    Nope.broken(:kaboom!)
    (rihanna) lib/rihanna/job_dispatcher.ex:134: anonymous fn/1 in Rihanna.JobDispatcher.spawn_supervised_task/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<2.72278995/0 in Rihanna.JobDispatcher.spawn_supervised_task/1>
    Args: []
.
10:47:59.164 [error] Task #PID<0.276.0> started from #PID<0.274.0> terminating
** (UndefinedFunctionError) function ErrorBehaviourMockWithNoErrorCallback.perform/1 is undefined (module ErrorBehaviourMockWithNoErrorCallback is not available)
    ErrorBehaviourMockWithNoErrorCallback.perform([#PID<0.272.0>, #Reference<0.2314301152.1576534022.148955>])
    (rihanna) lib/rihanna/job_dispatcher.ex:141: anonymous fn/1 in Rihanna.JobDispatcher.spawn_supervised_task/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<2.72278995/0 in Rihanna.JobDispatcher.spawn_supervised_task/1>
    Args: []
...
10:47:59.264 [error] Task #PID<0.284.0> started from #PID<0.282.0> terminating
** (RuntimeError) [Rihanna] Cannot execute MFA job because Rihanna was configured with the `behaviour_only` config option set to true.
    (rihanna) lib/rihanna/job_dispatcher.ex:132: anonymous fn/1 in Rihanna.JobDispatcher.spawn_supervised_task/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<2.72278995/0 in Rihanna.JobDispatcher.spawn_supervised_task/1>
    Args: []
..
10:47:59.508 [error] Task #PID<0.295.0> started from #PID<0.293.0> terminating
** (RuntimeError) Kaboom!
    (rihanna) test/support/mocks.ex:75: Rihanna.Mocks.BadMFAMock.perform/1
    (rihanna) lib/rihanna/job_dispatcher.ex:141: anonymous fn/1 in Rihanna.JobDispatcher.spawn_supervised_task/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<2.72278995/0 in Rihanna.JobDispatcher.spawn_supervised_task/1>
    Args: []
.
10:47:59.617 [error] Task #PID<0.300.0> started from #PID<0.298.0> terminating
** (RuntimeError) Kaboom!
    (rihanna) test/support/mocks.ex:75: Rihanna.Mocks.BadMFAMock.perform/1
    (rihanna) lib/rihanna/job_dispatcher.ex:134: anonymous fn/1 in Rihanna.JobDispatcher.spawn_supervised_task/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<2.72278995/0 in Rihanna.JobDispatcher.spawn_supervised_task/1>
    Args: []
.....
10:47:59.949 [error] Task #PID<0.322.0> started from #PID<0.320.0> terminating
** (UndefinedFunctionError) function Nope.broken/1 is undefined (module Nope is not available)
    Nope.broken(:kaboom!)
    (rihanna) lib/rihanna/job_dispatcher.ex:134: anonymous fn/1 in Rihanna.JobDispatcher.spawn_supervised_task/1
    (elixir) lib/task/supervised.ex:89: Task.Supervised.do_apply/2
    (elixir) lib/task/supervised.ex:38: Task.Supervised.reply/5
    (stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3
Function: #Function<2.72278995/0 in Rihanna.JobDispatcher.spawn_supervised_task/1>
    Args: []
..............................................

Finished in 3.7 seconds
69 tests, 0 failures

Randomized with seed 151891

Any idea what could be causing this? Thank you for this package, great work.

samsondav commented 6 years ago

Hi @angelo-moreira thank you for your comment and kind words.

Yes, the test suite is a bit rough and ready - the errors are completely normal, since we actually test some behaviour that results in an error. One thing to do might be to disable the logger entirely for the test run to avoid confusing people.

Might be a nice first PR for you, if you're interested in something like that.