elixir-lang/elixir

ExUnit.Case crashes if :group is supplied with an empty :parameterize list and async: is true

Closed this issue · 0 comments

Elixir and Erlang/OTP versions

Erlang/OTP 28 [erts-16.0.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] [jit] [dtrace]

Elixir 1.18.4 (compiled with Erlang/OTP 27)

Operating system

macOS Sequoia 15.6.1

Current behavior

If I define an ExUnit test module with a :group and an empty :parameterize list then the ExUnit runner crashes:

defmodule BugReportTest do
  use ExUnit.Case,
    async: true,
    parameterize: [],
    group: :some_group

  test "this will not run", _ctx do
    assert true
  end
end
% mix test
Compiling 1 file (.ex)
Generated bug_report app
Running ExUnit with seed: 476692, max_cases: 16


15:55:07.492 [error] Task #PID<0.159.0> started from #PID<0.94.0> terminating
** (FunctionClauseError) no function clause matching in ExUnit.Runner.spawn_modules/4
    (ex_unit 1.18.4) lib/ex_unit/runner.ex:160: ExUnit.Runner.spawn_modules(%{timeout: 60000, trace: false, exclude: [], include: [], seed: 476692, only_test_ids: nil, max_cases: 16, max_failures: :infinity, capture_log: false, rand_algorithm: :exsss, manager: {#PID<0.164.0>, #PID<0.165.0>}, runner_pid: #PID<0.159.0>, stats_pid: #PID<0.166.0>}, [some_group: []], true, %{})
    (ex_unit 1.18.4) lib/ex_unit/runner.ex:110: ExUnit.Runner.async_loop/4
    (ex_unit 1.18.4) lib/ex_unit/runner.ex:49: ExUnit.Runner.run_with_trap/2
    (ex_unit 1.18.4) lib/ex_unit/runner.ex:30: ExUnit.Runner.run/2
    (ex_unit 1.18.4) lib/ex_unit.ex:509: ExUnit.maybe_repeated_run/4
    (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
    (elixir 1.18.4) lib/task/supervised.ex:36: Task.Supervised.reply/4
Function: #Function<0.77447545/0 in ExUnit.async_run/0>
    Args: []
** (EXIT from #PID<0.94.0>) an exception was raised:
    ** (FunctionClauseError) no function clause matching in ExUnit.Runner.spawn_modules/4
        (ex_unit 1.18.4) lib/ex_unit/runner.ex:160: ExUnit.Runner.spawn_modules(%{timeout: 60000, trace: false, exclude: [], include: [], seed: 476692, only_test_ids: nil, max_cases: 16, max_failures: :infinity, capture_log: false, rand_algorithm: :exsss, manager: {#PID<0.164.0>, #PID<0.165.0>}, runner_pid: #PID<0.159.0>, stats_pid: #PID<0.166.0>}, [some_group: []], true, %{})
        (ex_unit 1.18.4) lib/ex_unit/runner.ex:110: ExUnit.Runner.async_loop/4
        (ex_unit 1.18.4) lib/ex_unit/runner.ex:49: ExUnit.Runner.run_with_trap/2
        (ex_unit 1.18.4) lib/ex_unit/runner.ex:30: ExUnit.Runner.run/2
        (ex_unit 1.18.4) lib/ex_unit.ex:509: ExUnit.maybe_repeated_run/4
        (elixir 1.18.4) lib/task/supervised.ex:101: Task.Supervised.invoke_mfa/2
        (elixir 1.18.4) lib/task/supervised.ex:36: Task.Supervised.reply/4

Expected behavior

% mix test 
Running ExUnit with seed: 679944, max_cases: 16


Finished in 0.00 seconds (0.00s async, 0.00s sync)
0 failures