khustochka

khustochka

Parallel compiler error when running tests on Github Actions

Hello!

I have an umbrella project and more often than not it fails when trying to run the tests, with the following error. This does not happen when running the tests locally.

Run mix ecto.setup && mix test
==> ornithologue

== Compilation error in file test/ornitho/schema/taxon_test.exs ==
** (MatchError) no match of right hand side value: {:error, :enoent}
    (elixir 1.16.2) lib/kernel/parallel_compiler.ex:540: Kernel.ParallelCompiler.require_file/2
    (elixir 1.16.2) lib/kernel/parallel_compiler.ex:430: anonymous fn/5 in Kernel.ParallelCompiler.spawn_workers/8
Error: .01:19:51.566 [error] GenServer Mix.ProjectStack terminating
** (FunctionClauseError) no function clause matching in anonymous fn/1 in Mix.ProjectStack.recur/1
    (mix 1.16.2) lib/mix/project_stack.ex:239: anonymous fn([]) in Mix.ProjectStack.recur/1
** (exit) exited in: GenServer.call(Mix.ProjectStack, {:update_stack, #Function<24.103597203/1 in Mix.ProjectStack.recur/1>}, :infinity)
    ** (EXIT) an exception was raised:
        ** (FunctionClauseError) no function clause matching in anonymous fn/1 in Mix.ProjectStack.recur/1
            (mix 1.16.2) lib/mix/project_stack.ex:239: anonymous fn([]) in Mix.ProjectStack.recur/1
            (mix 1.16.2) lib/mix/project_stack.ex:326: Mix.ProjectStack.handle_call/3
            (stdlib 5.2) gen_server.erl:1131: :gen_server.try_handle_call/4
            (stdlib 5.2) gen_server.erl:1160: :gen_server.handle_msg/6
            (stdlib 5.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
    (elixir 1.16.2) lib/gen_server.ex:1114: GenServer.call/3
    (mix 1.16.2) lib/mix/project_stack.ex:239: Mix.ProjectStack.recur/1
    (mix 1.16.2) lib/mix/cli.ex:96: Mix.CLI.run_task/2
    /home/runner/work/_temp/.setup-beam/elixir/bin/mix:2: (file)
    (elixir 1.16.2) lib/code.ex:1489: Code.require_file/2
    (mix 1.16.2) lib/mix/project_stack.ex:326: Mix.ProjectStack.handle_call/3
    (stdlib 5.2) gen_server.erl:1131: :gen_server.try_handle_call/4
    (stdlib 5.2) gen_server.erl:1160: :gen_server.handle_msg/6
    (stdlib 5.2) proc_lib.erl:241: :proc_lib.init_p_do_apply/3
Last message (from #PID<0.99.0>): {:update_stack, #Function<24.103597203/1 in Mix.ProjectStack.recur/1>}

As I said, it passes sometimes, but much more often it fails.

I found one topic here with the same/similar situation from 2018: Parallel compiler cannot find files sometimes, where the topic starter had error like this:

== Compilation error in file lib/sentry/logger.ex ==
** (MatchError) no match of right hand side value: {:error, :enoent}
    (elixir) lib/kernel/parallel_compiler.ex:198: anonymous fn/4 in Kernel.ParallelCompiler.spawn_workers/6
could not compile dependency :sentry, "mix compile" failed. You can recompile this dependency with "mix deps.compile sentry", update it with "mix deps.update sentry" or clean it with "mix deps.clean sentry"

I immediately see two differences:

  1. They had it failing during project building, while I have it failing when compiling a test script.
  2. Their error mentions the dependency compiler cannot find, in my case there is nothing.

This makes me think that maybe the not found dependency in my case is one of my umbrella dependencies?

First I suspected this may be caused by build caching in Github actions, but even disabling cache does not fix this.

Now I think maybe I declared the umberlla dependencies incorrectly, or running tests is not setup properly.

Any advice on how to investigate / debug this is greatly appreciated!

Thanks!

Marked As Solved

khustochka

khustochka

This has actually motivated me to investigate more and I think I found the issue.

I have one “unusual” test in the project (not the one mentioned in the error message). It tests a Mix task, so it calls Mix.run and Mix.rerun. It was declared with use Ornitho.RepoCase, async:true.

Removing async:true apparently has fixed the issue.

Where Next?

Popular in Questions Top

dotdotdotPaul
Okay, I'm having a heck of a time trying to figure out how to best handle the validation of belongs_to associations in Ecto. I'm sure I'...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
jerry
Good day to you all. I have been struggling to get a query involving like and ilike to work. Can anyone assist me on this, please? pro...
New
pgiesin
This should be a simple problem but I just can’t seem to figure it out. I have a standalone Elixir app that won’t find the database. Dep...
New
New
Harrisonl
We have an ECS cluster with 4 services, where each task joins a single cluster, via discovery ECS discovery service. Currently when I de...
New
dokuzbir
Hello, I am trying to convert my lists to string without losing brackets.For start i have 3 map. They look like these buyer = %{ id: ...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
malloryerik
Hi, this is for people who, like me, have had some friction using .html.heex templates in VSCode. The solution seems to be, in a hyphena...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New
Jim
As a follow up to my earlier question: I have the code compiling and running but not getting a successful login from the rest server. ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
minhajuddin
I have seen a lot of code which picks the first element from a list using Enum.at(0) instead of List.first. Is there a reason why people ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
Fl4m3Ph03n1x
About me? ( if you have nothing better to do than reading about some random guy in the internet :stuck_out_tongue: ) Hello all, this is ...
New
TunkShif
This post is an instruction guide to help you setup your Neovim for Elixir development from scratch. It includes general information on h...
273 38985 115
New

We're in Beta

About us Mission Statement