Make tests that mess with node or quorum state sequential

As most tests already are. It's highly unlikely that these
were meant to execute in parallel by design.
This commit is contained in:
Michael Klishin 2019-12-11 13:52:34 +03:00 committed by Jean-Sébastien Pédron
parent 8b7c83bf6e
commit 01e950fd18
31 changed files with 37 additions and 30 deletions

View File

@ -15,7 +15,7 @@
defmodule DeleteQueueCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Ctl.Commands.DeleteQueueCommand

View File

@ -15,7 +15,7 @@
defmodule ExportDefinitionsCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Ctl.Commands.ExportDefinitionsCommand

View File

@ -15,7 +15,7 @@
defmodule ImportDefinitionsCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Ctl.Commands.ImportDefinitionsCommand

View File

@ -15,7 +15,7 @@
defmodule PurgeQueueCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Ctl.Commands.PurgeQueueCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule AlarmsCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
import RabbitMQ.CLI.Core.Alarms, only: [alarm_types: 1]

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule CheckAlarmsCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
import RabbitMQ.CLI.Core.Alarms, only: [alarm_types: 1]

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule CheckLocalAlarmsCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
import RabbitMQ.CLI.Core.Alarms, only: [alarm_types: 1]

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule CheckPortConnectivityCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.CheckPortConnectivityCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule CheckPortListenerCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.CheckPortListenerCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule CheckProtocolListenerCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.CheckProtocolListenerCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule CheckRunningCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.CheckRunningCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule CheckVirtualHostsCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.CheckVirtualHostsCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule ConsumeEventStreamCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.ConsumeEventStreamCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule DiscoverPeersCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.DiscoverPeersCommand
@ -35,7 +35,7 @@ defmodule DiscoverPeersCommandTest do
assert @command.validate(["a"], context[:opts]) ==
{:validation_failure, :too_many_args}
end
@tag test_timeout: 15000
test "run: returns a list of nodes when the backend isn't configured", context do
assert match?({:ok, {[], _}}, @command.run([], context[:opts]))

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule IsBootingCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.IsBootingCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule IsRunningCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.IsRunningCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule ListenersCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
import RabbitMQ.CLI.Core.Listeners, only: [listener_maps: 1]

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule LogLocationCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.LogLocationCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule LogTailCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.LogTailCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule LogTailStreamCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.LogTailStreamCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2016-2017 Pivotal Software, Inc. All rights reserved.
defmodule MemoryBreakdownCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.MemoryBreakdownCommand
@ -22,7 +22,6 @@ defmodule MemoryBreakdownCommandTest do
setup_all do
RabbitMQ.CLI.Core.Distribution.start()
start_rabbitmq_app()
on_exit([], fn ->

View File

@ -15,7 +15,7 @@
defmodule ObserverCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Diagnostics.Commands.ObserverCommand

View File

@ -33,7 +33,10 @@ defmodule DisablePluginsCommandTest do
[:rabbit, :plugins_dir])
rabbitmq_home = :rabbit_misc.rpc_call(node, :code, :lib_dir, [:rabbit])
IO.puts("plugins disable tests default env: enabled plugins = #{plugins_file}, plugins dir = #{plugins_dir}, RabbitMQ home directory = #{rabbitmq_home}")
{:ok, [enabled_plugins]} = :file.consult(plugins_file)
IO.puts("plugins disable tests will assume tnat #{Enum.join(enabled_plugins, ",")} is the list of enabled plugins to revert to")
opts = %{enabled_plugins_file: plugins_file,
plugins_dir: plugins_dir,

View File

@ -33,7 +33,10 @@ defmodule EnablePluginsCommandTest do
[:rabbit, :plugins_dir])
rabbitmq_home = :rabbit_misc.rpc_call(node, :code, :lib_dir, [:rabbit])
IO.puts("plugins enable tests default env: enabled plugins = #{plugins_file}, plugins dir = #{plugins_dir}, RabbitMQ home directory = #{rabbitmq_home}")
{:ok, [enabled_plugins]} = :file.consult(plugins_file)
IO.puts("plugins enable tests will assume tnat #{Enum.join(enabled_plugins, ",")} is the list of enabled plugins to revert to")
opts = %{enabled_plugins_file: plugins_file,
plugins_dir: plugins_dir,

View File

@ -36,8 +36,10 @@ defmodule ListPluginsCommandTest do
:application, :get_env,
[:rabbit, :plugins_dir])
rabbitmq_home = :rabbit_misc.rpc_call(node, :code, :lib_dir, [:rabbit])
IO.puts("plugins list tests default env: enabled plugins = #{plugins_file}, plugins dir = #{plugins_dir}, RabbitMQ home directory = #{rabbitmq_home}")
{:ok, [enabled_plugins]} = :file.consult(plugins_file)
IO.puts("plugins list tests will assume tnat #{Enum.join(enabled_plugins, ",")} is the list of enabled plugins to revert to")
opts = %{enabled_plugins_file: plugins_file,
plugins_dir: plugins_dir,

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule RabbitMQ.CLI.Queues.Commands.AddMemberCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Queues.Commands.AddMemberCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule RabbitMQ.CLI.Queues.Commands.DeleteMemberCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Queues.Commands.DeleteMemberCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule RabbitMQ.CLI.Queues.Commands.GrowCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Queues.Commands.GrowCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule RabbitMQ.CLI.Queues.Commands.QuorumQueuesCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Queues.Commands.QuorumStatusCommand

View File

@ -14,7 +14,7 @@
## Copyright (c) 2007-2019 Pivotal Software, Inc. All rights reserved.
defmodule RabbitMQ.CLI.Queues.Commands.ShrinkCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Queues.Commands.ShrinkCommand

View File

@ -15,7 +15,7 @@
defmodule PostUpgradeCommandTest do
use ExUnit.Case
use ExUnit.Case, async: false
import TestHelper
@command RabbitMQ.CLI.Upgrade.Commands.PostUpgradeCommand