khustochka

khustochka

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!

Showing Posts 1 to 1

khustochka

khustochka OP

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.

— All posts loaded —

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
Blokh
Hey guys, I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly Do you guys have any suggestions what is the best prac...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
kszambelanczyk
Hello! Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app. I creat...
New
subsaharancoder
I’ve followed the Phoenix LiveView file upload code here Uploads — Phoenix LiveView v1.0.0-rc.7 and so far everything works just fine wit...
New
Onor.io
I have what I’ve heard referred to as a “lookup table” in my database. This is a way of assigning codes to common values. One common lo...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews