tjchambers
Oban testing with elixir and python
I am trying to bridge Elixir and Python, and am getting a failure in testing.
** (RuntimeError) unknown worker: agr.__main__.AgrWorker
code: Oban.Testing.with_testing_mode(:inline, fn ->
stacktrace:
(oban 2.21.1) lib/oban/queue/executor.ex:109: Oban.Queue.Executor.resolve_worker/1
(oban 2.21.1) lib/oban/queue/executor.ex:74: Oban.Queue.Executor.call/1
(oban 2.21.1) lib/oban/engines/inline.ex:104: Oban.Engines.Inline.execute_job/2
(oban 2.21.1) lib/oban/engines/inline.ex:37: Oban.Engines.Inline.insert_job/3
(oban 2.21.1) lib/oban/engine.ex:216: anonymous fn/4 in Oban.Engine.insert_job/3
(oban 2.21.1) lib/oban/engine.ex:404: anonymous fn/3 in Oban.Engine.with_span/4
As far as I can tell using code I have deduced my Python worker is “_main_.AgrWorker" however no matter what I put in as a worker name, I get an error in finding the worker on the elixir side when I run my tests. I am running my test inline for a worker (an Elixir module). This elixir module enqueues a job which is for a Python class “AgrWorker”. It “seems” like what is happening is that because the test is “inline” on th Elixir side, the subsequent enqueue expects any subsequent Oban Job to also be in Elixir - i.e. it is looking for the Elixir worker to run.
I am not sure how or why it would be able to know about all of the Python Workers available.
Can anyone help me with why this makes any sense?
Most Liked Responses
kokolegorille
If You don’t mind I have switched the OP section from Question to Oban.









