elixir-lang / elixir

Elixir is a dynamic, functional language for building scalable and maintainable applications
https://elixir-lang.org/
Apache License 2.0
24.37k stars 3.36k forks source link

Elixir unit test failures with OTP-27.1.1 #13877

Closed deepankar-j closed 6 days ago

deepankar-j commented 6 days ago

Elixir and Erlang/OTP versions

Erlang/OTP 27 [erts-15.0.1] [source] [64-bit] [smp:10:10] [ds:10:10:10] [async-threads:1] [jit]

Elixir 1.17.3 (compiled with Erlang/OTP 27)

Operating system

Ubuntu 22.04

Current behavior

When compiling Elixir v1.7.3 from source against Erlang OTP-27.1.1, we see the following unit test failures.

#17 95.38 ==> logger (ex_unit)
#17 97.41 Running ExUnit with seed: 837067, max_cases: 8
#17 97.41 
#17 97.41 ......................................................
#17 97.68 
#17 97.68   1) test translates Supervisor progress (Logger.TranslatorTest)
#17 97.68      test/logger/translator_test.exs:948
#17 97.68      Assertion with =~ failed
#17 97.68      code:  assert capture_log(:info, fn ->
#17 97.68               ref = Process.monitor(pid)
#17 97.68               Supervisor.start_child(pid, worker(Task, [__MODULE__, :sleep, [self()]]))
#17 97.68               Process.exit(pid, :normal)
#17 97.68 
#17 97.68               receive do
#17 97.68                 {:DOWN, ^ref, _, _, _} -> :ok
#17 97.68               end
#17 97.68             end) =~ ~r"\[info\] Child Task of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) started
#17 97.68             Pid: #PID<\d+\.\d+\.\d+>
#17 97.68             Start Call: Task.start_link\(Logger.TranslatorTest, :sleep, \[#PID<\d+\.\d+\.\d+>\]\)
#17 97.68             "
#17 97.68      left:  ""
#17 97.68      right: ~r/\[info\] Child Task of Supervisor #PID<\d+\.\d+\.\d+> \(Supervisor\.Default\) started\nPid: #PID<\d+\.\d+\.\d+>\nStart Call: Task.start_link\(Logger.TranslatorTest, :sleep, \[#PID<\d+\.\d+\.\d+>\]\)\n/
#17 97.68      stacktrace:
#17 97.68        test/logger/translator_test.exs:951: (test)
#17 97.68 
#17 97.68 .............
#17 97.69 
#17 97.69   2) test translates Supervisor progress with name (Logger.TranslatorTest)
#17 97.69      test/logger/translator_test.exs:963
#17 97.69      Assertion with =~ failed
#17 97.69      code:  assert capture_log(:info, fn ->
#17 97.69               ref = Process.monitor(pid)
#17 97.69               Supervisor.start_child(pid, worker(Task, [__MODULE__, :sleep, [self()]]))
#17 97.69               Process.exit(pid, :normal)
#17 97.69 
#17 97.69               receive do
#17 97.69                 {:DOWN, ^ref, _, _, _} -> :ok
#17 97.69               end
#17 97.69             end) =~ ~r"\[info\] Child Task of Supervisor Logger.TranslatorTest started
#17 97.69             "
#17 97.69      left:  ""
#17 97.69      right: ~r/\[info\] Child Task of Supervisor Logger.TranslatorTest started\n/
#17 97.69      stacktrace:
#17 97.69        test/logger/translator_test.exs:966: (test)
#17 97.69 
#17 97.69 ...........................................................................................
#17 98.01 Finished in 2.1 seconds (1.5s on load, 0.01s async, 0.5s sync)
#17 98.01 3 doctests, 157 tests, 2 failures

Expected behavior

No unit test failures.

josevalim commented 6 days ago

Fixed in main/v1.17 already.

sabiwara commented 6 days ago

For reference: duplicate of https://github.com/elixir-lang/elixir/issues/13848 and https://github.com/elixir-lang/elixir/issues/13849

deepankar-j commented 6 days ago

Thank you and my apologies for missing those in the closed issues!