Created attachment 666638 [details] emerge --info 1) test compiles code (Kernel.CLI.CompileTest) test/elixir/kernel/cli_test.exs:120 Assertion with == failed code: assert :code.which(CompileSample) |> List.to_string() == Path.expand(context[:beam_file_path]) left: "" right: "/mnt/portagetmp/portage/dev-lang/elixir-1.10.4/work/elixir-1.10.4/lib/elixir/tmp/beams/120/Elixir.CompileSample.beam" stacktrace: test/elixir/kernel/cli_test.exs:126: (test)
Created attachment 666641 [details] build.log
Does it fail for you every time you run a test? Or happens only occasionally? We saw it in bug #727344 as well. It's somehow very hard to reproduce. Makes it hard to debug and understand why it happens at all. My suspiction is on some (old?) epmd daemon running.
My speculation is that problem happens when one test collides with another when compiles (or loads? or maybe cleans up?) CompileSample sample module. $ git grep CompileSample | cat lib/elixir/test/elixir/code_test.exs: assert [{CompileSample, binary}] = Code.compile_file(fixture_path("compile_sample.ex")) lib/elixir/test/elixir/code_test.exs: :code.purge(CompileSample) lib/elixir/test/elixir/code_test.exs: :code.delete(CompileSample) lib/elixir/test/elixir/code_test.exs: assert [{CompileSample, binary}] = Code.require_file(fixture_path("compile_sample.ex")) lib/elixir/test/elixir/code_test.exs: :code.purge(CompileSample) lib/elixir/test/elixir/code_test.exs: :code.delete(CompileSample) lib/elixir/test/elixir/fixtures/compile_sample.ex:defmodule(CompileSample, do: nil) lib/elixir/test/elixir/kernel/cli_test.exs: beam_file_path = Path.join([context.tmp_dir, "Elixir.CompileSample.beam"]) lib/elixir/test/elixir/kernel/cli_test.exs: assert :code.which(CompileSample) |> List.to_string() == Path.expand(context.beam_file_path) lib/elixir/test/elixir/kernel/cli_test.exs: :code.purge(CompileSample) lib/elixir/test/elixir/kernel/cli_test.exs: :code.delete(CompileSample) lib/elixir/test/elixir/kernel/cli_test.exs: assert :code.which(CompileSample) |> List.to_string() == Path.expand(context[:beam_file_path]) lib/elixir/test/elixir/kernel/cli_test.exs: :code.purge(CompileSample) lib/elixir/test/elixir/kernel/cli_test.exs: :code.delete(CompileSample)
It happened once, but not again.
Reliably able to run and pass tests of Elixir 1.11.4 (oldest in tree) and 1.13.3 (newest in tree) on Erlang 24.2.2. Assuming only this old version is affected.