summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <mklishin@pivotal.io>2019-04-12 02:27:15 +0400
committerMichael Klishin <mklishin@pivotal.io>2019-04-12 02:27:15 +0400
commit66d6cf117359147444f5039d7b1ff7b8d4f7356b (patch)
tree602e688c2d2e782e5e0fe6693c41eaaafe3f1853
parent60fc0ee25c04e5da1056f1bc7b7b2962c36cb845 (diff)
downloadrabbitmq-server-git-66d6cf117359147444f5039d7b1ff7b8d4f7356b.tar.gz
Update :badrpc test cases to be more resilient (part 2)
On some networks the response is a timeout, not a nodedown. That's acceptable for this test.
-rw-r--r--deps/rabbitmq_cli/test/ctl/add_user_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/add_vhost_command_test.exs4
-rw-r--r--deps/rabbitmq_cli/test/ctl/authenticate_user_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/await_online_nodes_command_test.exs4
-rw-r--r--deps/rabbitmq_cli/test/ctl/await_startup_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/cancel_sync_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/change_cluster_node_type_command_test.exs9
-rw-r--r--deps/rabbitmq_cli/test/ctl/change_password_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_global_parameter_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_operator_policy_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_parameter_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_password_command_test.exs7
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_permissions_command_test.exs5
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_policy_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_topic_permissions_command_test.exs5
-rw-r--r--deps/rabbitmq_cli/test/ctl/clear_vhost_limits_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/close_all_connections_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/close_connection_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/cluster_status_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/delete_user_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/delete_vhost_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/enable_feature_flag_test.exs4
-rw-r--r--deps/rabbitmq_cli/test/ctl/environment_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/eval_command_test.exs9
-rw-r--r--deps/rabbitmq_cli/test/ctl/force_gc_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/force_reset_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/forget_cluster_node_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/ctl/join_cluster_command_test.exs18
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_feature_flags_command_test.exs5
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_operator_policies_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_parameters_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_permissions_command_test.exs5
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_policies_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_topic_permissions_command_test.exs5
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_user_permissions_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_user_topic_permissions_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_users_command_test.exs3
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_vhost_limits_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/list_vhosts_command_test.exs5
-rw-r--r--deps/rabbitmq_cli/test/ctl/node_health_check_command_test.exs9
-rw-r--r--deps/rabbitmq_cli/test/ctl/ping_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/report_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/reset_command_test.exs10
-rw-r--r--deps/rabbitmq_cli/test/ctl/restart_vhost_command_test.exs9
-rw-r--r--deps/rabbitmq_cli/test/ctl/rotate_logs_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_cluster_name_command_test.exs5
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_global_parameter_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_log_level_command_test.exs7
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_operator_policy_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_parameter_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_permissions_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_policy_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_topic_permissions_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_user_tags_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/set_vhost_limits_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/shutdown_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/start_app_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/status_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/stop_app_command_test.exs8
-rw-r--r--deps/rabbitmq_cli/test/ctl/stop_command_test.exs12
-rw-r--r--deps/rabbitmq_cli/test/ctl/sync_queue_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/trace_off_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/trace_on_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/ctl/update_cluster_nodes_command_test.exs16
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs6
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs2
-rw-r--r--deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs2
81 files changed, 172 insertions, 300 deletions
diff --git a/deps/rabbitmq_cli/test/ctl/add_user_command_test.exs b/deps/rabbitmq_cli/test/ctl/add_user_command_test.exs
index 3d20741cdc..1bfdcc4c20 100644
--- a/deps/rabbitmq_cli/test/ctl/add_user_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/add_user_command_test.exs
@@ -48,11 +48,9 @@ defmodule AddUserCommandTest do
end
@tag user: "someone", password: "password"
- test "run: request to a non-existent node returns nodedown", context do
- target = :jake@thedog
-
- opts = %{node: target}
- assert match?({:badrpc, :nodedown}, @command.run([context[:user], context[:password]], opts))
+ test "run: request to a non-existent node returns a badrpc", context do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([context[:user], context[:password]], opts))
end
@tag user: "someone", password: "password"
diff --git a/deps/rabbitmq_cli/test/ctl/add_vhost_command_test.exs b/deps/rabbitmq_cli/test/ctl/add_vhost_command_test.exs
index 2564b6ea91..17d144c9a4 100644
--- a/deps/rabbitmq_cli/test/ctl/add_vhost_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/add_vhost_command_test.exs
@@ -49,8 +49,8 @@ defmodule AddVhostCommandTest do
end
test "run: attempt to use an unreachable node returns a nodedown" do
- opts = %{node: :jake@thedog, timeout: 3000}
- assert @command.run(["na"], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["na"], opts))
end
test "run: adding the same host twice is idempotent", context do
diff --git a/deps/rabbitmq_cli/test/ctl/authenticate_user_command_test.exs b/deps/rabbitmq_cli/test/ctl/authenticate_user_command_test.exs
index b6890cebd7..388c57405d 100644
--- a/deps/rabbitmq_cli/test/ctl/authenticate_user_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/authenticate_user_command_test.exs
@@ -51,10 +51,8 @@ defmodule AuthenticateUserCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert @command.run(["user", "password"], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["user", "password"], opts))
end
@tag user: @user, password: "treachery"
diff --git a/deps/rabbitmq_cli/test/ctl/await_online_nodes_command_test.exs b/deps/rabbitmq_cli/test/ctl/await_online_nodes_command_test.exs
index 53a2433276..0dcda6db7a 100644
--- a/deps/rabbitmq_cli/test/ctl/await_online_nodes_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/await_online_nodes_command_test.exs
@@ -42,8 +42,8 @@ defmodule AwaitOnlineNodesCommandTest do
end
test "run: a call to an unreachable RabbitMQ node returns a nodedown" do
- opts = %{node: :jake@thedog, timeout: 3000}
- assert @command.run(["1"], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["1"], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/await_startup_command_test.exs b/deps/rabbitmq_cli/test/ctl/await_startup_command_test.exs
index b17dc29d99..39a15a41e7 100644
--- a/deps/rabbitmq_cli/test/ctl/await_startup_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/await_startup_command_test.exs
@@ -43,11 +43,9 @@ defmodule AwaitStartupCommandTest do
{:validation_failure, :too_many_args}
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, timeout: 5}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "run: request to a fully booted node succeeds", context do
diff --git a/deps/rabbitmq_cli/test/ctl/cancel_sync_command_test.exs b/deps/rabbitmq_cli/test/ctl/cancel_sync_command_test.exs
index c1e3328315..94cdaae47b 100644
--- a/deps/rabbitmq_cli/test/ctl/cancel_sync_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/cancel_sync_command_test.exs
@@ -61,10 +61,8 @@ defmodule CancelSyncQueueCommandTest do
end
test "run: request to a non-existent RabbitMQ node returns a nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: @vhost}
- assert match?({:badrpc, :nodedown}, @command.run(["q1"], opts))
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["q1"], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/change_cluster_node_type_command_test.exs b/deps/rabbitmq_cli/test/ctl/change_cluster_node_type_command_test.exs
index 1a73cf2c37..841852efb1 100644
--- a/deps/rabbitmq_cli/test/ctl/change_cluster_node_type_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/change_cluster_node_type_command_test.exs
@@ -74,13 +74,8 @@ defmodule ChangeClusterNodeTypeCommandTest do
@command.run(["ram"], context[:opts]))
end
- test "run: request to an unreachable node returns nodedown", _context do
- target = :jake@thedog
-
- opts = %{
- node: target
- }
- # We use "self" node as the target. It's enough to trigger the error.
+ test "run: request to an unreachable node returns a badrpc", _context do
+ opts = %{node: :jake@thedog, timeout: 200}
assert match?(
{:badrpc, :nodedown},
@command.run(["ram"], opts))
diff --git a/deps/rabbitmq_cli/test/ctl/change_password_command_test.exs b/deps/rabbitmq_cli/test/ctl/change_password_command_test.exs
index e966007817..0f5599b690 100644
--- a/deps/rabbitmq_cli/test/ctl/change_password_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/change_password_command_test.exs
@@ -49,10 +49,8 @@ defmodule ChangePasswordCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert @command.run(["user", "password"], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["user", "password"], opts))
end
@tag user: @user, password: @password
diff --git a/deps/rabbitmq_cli/test/ctl/clear_global_parameter_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_global_parameter_command_test.exs
index e3f922fdb9..cf0b6e4d66 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_global_parameter_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_global_parameter_command_test.exs
@@ -59,10 +59,8 @@ defmodule ClearGlobalParameterCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert @command.run([@key], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([@key], opts))
end
@tag key: @key
diff --git a/deps/rabbitmq_cli/test/ctl/clear_operator_policy_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_operator_policy_command_test.exs
index 8d05fe8c8b..f0842f5781 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_operator_policy_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_operator_policy_command_test.exs
@@ -84,10 +84,8 @@ defmodule ClearOperatorPolicyCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: "/"}
- assert @command.run([@key], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
+ assert match?({:badrpc, _}, @command.run([@key], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/clear_parameter_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_parameter_command_test.exs
index dd3292c70a..c0fd9b59d2 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_parameter_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_parameter_command_test.exs
@@ -82,10 +82,8 @@ defmodule ClearParameterCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: "/"}
- assert @command.run([@component_name, @key], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
+ assert match?({:badrpc, _}, @command.run([@component_name, @key], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/clear_password_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_password_command_test.exs
index 7d435348d4..a285f35b45 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_password_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_password_command_test.exs
@@ -46,11 +46,8 @@ defmodule ClearPasswordCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
-
- opts = %{node: target}
-
- assert @command.run(["user"], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["user"], opts))
end
@tag user: "interloper"
diff --git a/deps/rabbitmq_cli/test/ctl/clear_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_permissions_command_test.exs
index b93a0f9e98..4a8af90c68 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_permissions_command_test.exs
@@ -72,11 +72,10 @@ defmodule ClearPermissionsTest do
end
test "run: on an invalid node, return a badrpc message" do
- bad_node = :jake@thedog
arg = ["some_name"]
- opts = %{node: bad_node, vhost: ""}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- assert @command.run(arg, opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(arg, opts))
end
@tag user: @user, vhost: @specific_vhost
diff --git a/deps/rabbitmq_cli/test/ctl/clear_policy_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_policy_command_test.exs
index ed78d2c01c..9667af07e7 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_policy_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_policy_command_test.exs
@@ -86,10 +86,8 @@ defmodule ClearPolicyCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: "/"}
- assert @command.run([@key], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
+ assert match?({:badrpc, _}, @command.run([@key], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/clear_topic_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_topic_permissions_command_test.exs
index dd46631cb8..06cf2a8b79 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_topic_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_topic_permissions_command_test.exs
@@ -85,11 +85,10 @@ defmodule ClearTopicPermissionsTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- bad_node = :jake@thedog
arg = ["some_name"]
- opts = %{node: bad_node, vhost: ""}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- assert @command.run(arg, opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(arg, opts))
end
@tag user: @user, vhost: @specific_vhost
diff --git a/deps/rabbitmq_cli/test/ctl/clear_vhost_limits_command_test.exs b/deps/rabbitmq_cli/test/ctl/clear_vhost_limits_command_test.exs
index 71b970817e..688598af9c 100644
--- a/deps/rabbitmq_cli/test/ctl/clear_vhost_limits_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/clear_vhost_limits_command_test.exs
@@ -68,10 +68,8 @@ defmodule ClearVhostLimitsCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: "/"}
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/close_all_connections_command_test.exs b/deps/rabbitmq_cli/test/ctl/close_all_connections_command_test.exs
index 52f36c85b5..14aef31351 100644
--- a/deps/rabbitmq_cli/test/ctl/close_all_connections_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/close_all_connections_command_test.exs
@@ -99,11 +99,9 @@ defmodule CloseAllConnectionsCommandTest do
end)
end
- test "run: a close_all_connections request to non-existent RabbitMQ node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: @vhost, global: true, per_connection_delay: 0, limit: 0}
- assert match?({:badrpc, :nodedown}, @command.run(["test"], opts))
+ test "run: a close_all_connections request to non-existent RabbitMQ node returns a badrpc" do
+ opts = %{node: :jake@thedog, vhost: @vhost, global: true, per_connection_delay: 0, limit: 0, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["test"], opts))
end
test "banner for vhost option", context do
diff --git a/deps/rabbitmq_cli/test/ctl/close_connection_command_test.exs b/deps/rabbitmq_cli/test/ctl/close_connection_command_test.exs
index 2b2a3fa573..db4e230e88 100644
--- a/deps/rabbitmq_cli/test/ctl/close_connection_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/close_connection_command_test.exs
@@ -68,11 +68,9 @@ defmodule CloseConnectionCommandTest do
@command.run(["<#{node()}.2.121.12>", "test"], %{node: @helpers.normalise_node(context[:node], :shortnames)}))
end
- test "run: a close_connection request on nonexistent RabbitMQ node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert match?({:badrpc, :nodedown}, @command.run(["<rabbit@localhost.1.2.1>", "test"], opts))
+ test "run: a close_connection request on nonexistent RabbitMQ node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["<rabbit@localhost.1.2.1>", "test"], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/cluster_status_command_test.exs b/deps/rabbitmq_cli/test/ctl/cluster_status_command_test.exs
index ead9ae4c83..1a382ca9cf 100644
--- a/deps/rabbitmq_cli/test/ctl/cluster_status_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/cluster_status_command_test.exs
@@ -41,12 +41,10 @@ defmodule ClusterStatusCommandTest do
assert @command.run([], context[:opts])[:nodes] != nil
end
- test "run: status request on nonexistent RabbitMQ node returns nodedown" do
- target = :jake@thedog
+ test "run: status request on nonexistent RabbitMQ node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target}
-
- assert @command.run([], opts) != nil
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/delete_user_command_test.exs b/deps/rabbitmq_cli/test/ctl/delete_user_command_test.exs
index 77075cb95f..2237da6abd 100644
--- a/deps/rabbitmq_cli/test/ctl/delete_user_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/delete_user_command_test.exs
@@ -49,11 +49,9 @@ defmodule DeleteUserCommandTest do
end
test "run: An invalid Rabbit node returns a bad rpc message" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target}
-
- assert @command.run(["username"], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["username"], opts))
end
@tag user: @user
diff --git a/deps/rabbitmq_cli/test/ctl/delete_vhost_command_test.exs b/deps/rabbitmq_cli/test/ctl/delete_vhost_command_test.exs
index bcc35bb3cb..7e35acb888 100644
--- a/deps/rabbitmq_cli/test/ctl/delete_vhost_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/delete_vhost_command_test.exs
@@ -56,11 +56,9 @@ defmodule DeleteVhostCommandTest do
end
test "run: A call to invalid or inactive RabbitMQ node returns a nodedown" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target}
-
- assert @command.run(["na"], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["na"], opts))
end
@tag vhost: @vhost
diff --git a/deps/rabbitmq_cli/test/ctl/enable_feature_flag_test.exs b/deps/rabbitmq_cli/test/ctl/enable_feature_flag_test.exs
index 32f0c3ef72..69d5076b45 100644
--- a/deps/rabbitmq_cli/test/ctl/enable_feature_flag_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/enable_feature_flag_test.exs
@@ -45,8 +45,8 @@ defmodule EnableFeatureFlagCommandTest do
end
test "run: attempt to use an unreachable node returns a nodedown" do
- opts = %{node: :jake@thedog, timeout: 3000}
- assert @command.run(["na"], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["na"], opts))
end
test "run: enabling the same feature flag twice is idempotent", context do
diff --git a/deps/rabbitmq_cli/test/ctl/environment_command_test.exs b/deps/rabbitmq_cli/test/ctl/environment_command_test.exs
index 19c3fec964..36307b1114 100644
--- a/deps/rabbitmq_cli/test/ctl/environment_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/environment_command_test.exs
@@ -42,12 +42,10 @@ defmodule EnvironmentCommandTest do
assert @command.run([], context[:opts])[:rabbit] != nil
end
- test "run: environment request on nonexistent RabbitMQ node returns nodedown" do
- target = :jake@thedog
+ test "run: environment request on nonexistent RabbitMQ node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target}
-
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/eval_command_test.exs b/deps/rabbitmq_cli/test/ctl/eval_command_test.exs
index 36b5de6a19..66366790da 100644
--- a/deps/rabbitmq_cli/test/ctl/eval_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/eval_command_test.exs
@@ -44,13 +44,10 @@ defmodule EvalCommandTest do
assert @command.validate(["foo bar", "foo"], %{}) == {:validation_failure, "syntax error before: bar"}
end
- test "run: request to a non-existent node returns nodedown", _context do
- target = :jake@thedog
+ test "run: request to a non-existent node returns a badrpc", _context do
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target}
-
-
- assert @command.run(["ok."], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["ok."], opts))
end
test "run: evaluates provided Erlang expression", context do
diff --git a/deps/rabbitmq_cli/test/ctl/force_gc_command_test.exs b/deps/rabbitmq_cli/test/ctl/force_gc_command_test.exs
index 366816242c..3a9123f4be 100644
--- a/deps/rabbitmq_cli/test/ctl/force_gc_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/force_gc_command_test.exs
@@ -33,7 +33,7 @@ defmodule ForceGcCommandTest do
end
setup do
- {:ok, opts: %{node: get_rabbit_hostname(), timeout: 70000}}
+ {:ok, opts: %{node: get_rabbit_hostname(), timeout: 200}}
end
@@ -45,10 +45,8 @@ defmodule ForceGcCommandTest do
assert @command.validate(["extra"], context[:opts]) == {:validation_failure, :too_many_args}
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- assert match?({:badrpc, _}, @command.run([], %{node: target, timeout: 70000}))
+ test "run: request to a non-existent node returns a badrpc" do
+ assert match?({:badrpc, _}, @command.run([], %{node: :jake@thedog, timeout: 200}))
end
test "run: request to a named, active node succeeds", context do
diff --git a/deps/rabbitmq_cli/test/ctl/force_reset_command_test.exs b/deps/rabbitmq_cli/test/ctl/force_reset_command_test.exs
index f362173921..c714b98126 100644
--- a/deps/rabbitmq_cli/test/ctl/force_reset_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/force_reset_command_test.exs
@@ -58,10 +58,8 @@ defmodule ForceResetCommandTest do
assert vhost_exists? "some_vhost"
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target}
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
assert match?({:badrpc, _}, @command.run([], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/forget_cluster_node_command_test.exs b/deps/rabbitmq_cli/test/ctl/forget_cluster_node_command_test.exs
index 49c7e9e3c8..16fa272bdd 100644
--- a/deps/rabbitmq_cli/test/ctl/forget_cluster_node_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/forget_cluster_node_command_test.exs
@@ -96,7 +96,7 @@ defmodule ForgetClusterNodeCommandTest do
@command.validate_execution_environment(["other_node@localhost"], opts_without_mnesia))
end
- test "run: online request to a non-existent node returns nodedown", context do
+ test "run: online request to a non-existent node returns a badrpc", context do
assert match?(
{:badrpc, :nodedown},
@command.run([context[:opts][:node]],
diff --git a/deps/rabbitmq_cli/test/ctl/join_cluster_command_test.exs b/deps/rabbitmq_cli/test/ctl/join_cluster_command_test.exs
index faba1ab84b..4a3df293e8 100644
--- a/deps/rabbitmq_cli/test/ctl/join_cluster_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/join_cluster_command_test.exs
@@ -81,27 +81,23 @@ defmodule JoinClusterCommandTest do
@command.run([context[:opts][:node]], context[:opts]))
end
- test "run: request to a non-existent node returns nodedown", context do
- target = :jake@thedog
-
+ test "run: request to a non-existent node returns a badrpc", context do
opts = %{
- node: target,
+ node: :jake@thedog,
disc: true,
ram: false,
+ timeout: 200
}
- # We use "self" node as the target. It's enough to trigger the error.
assert match?(
- {:badrpc, :nodedown},
+ {:badrpc, _},
@command.run([context[:opts][:node]], opts))
end
- test "run: joining a non-existent node returns nodedown", context do
- target = :jake@thedog
-
+ test "run: joining a non-existent node returns a badrpc", context do
stop_rabbitmq_app()
assert match?(
- {:badrpc_multi, :nodedown, [_]},
- @command.run([target], context[:opts]))
+ {:badrpc_multi, _, [_]},
+ @command.run([:jake@thedog], context[:opts]))
start_rabbitmq_app()
end
diff --git a/deps/rabbitmq_cli/test/ctl/list_feature_flags_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_feature_flags_command_test.exs
index 9feed72c5b..74cef3965d 100644
--- a/deps/rabbitmq_cli/test/ctl/list_feature_flags_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_feature_flags_command_test.exs
@@ -73,9 +73,8 @@ defmodule ListFeatureFlagsCommandTest do
end
test "run: on a bad RabbitMQ node, return a badrpc" do
- target = :jake@thedog
- opts = %{node: target, timeout: :infinity}
- assert @command.run(["name"], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["name"], opts))
end
@tag test_timeout: :infinity
diff --git a/deps/rabbitmq_cli/test/ctl/list_operator_policies_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_operator_policies_command_test.exs
index f137d0f8f5..216e7a948a 100644
--- a/deps/rabbitmq_cli/test/ctl/list_operator_policies_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_operator_policies_command_test.exs
@@ -77,11 +77,9 @@ defmodule ListOperatorPoliciesCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: 200}
- opts = %{node: target, vhost: @vhost, timeout: :infinity}
-
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag key: @key, pattern: @pattern, value: @value, vhost: @root
diff --git a/deps/rabbitmq_cli/test/ctl/list_parameters_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_parameters_command_test.exs
index 94711316f9..f397462414 100644
--- a/deps/rabbitmq_cli/test/ctl/list_parameters_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_parameters_command_test.exs
@@ -92,11 +92,9 @@ defmodule ListParametersCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: 200}
- opts = %{node: target, vhost: @vhost, timeout: :infinity}
-
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag component_name: @component_name, key: @key, value: @value, vhost: @root
diff --git a/deps/rabbitmq_cli/test/ctl/list_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_permissions_command_test.exs
index 11c8ca9b4e..9be6c001ee 100644
--- a/deps/rabbitmq_cli/test/ctl/list_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_permissions_command_test.exs
@@ -65,10 +65,9 @@ defmodule ListPermissionsCommandTest do
end
test "run: on a bad RabbitMQ node, return a badrpc" do
- target = :jake@thedog
- opts = %{node: target, timeout: :infinity, vhost: "/"}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag test_timeout: @default_timeout, vhost: @vhost
diff --git a/deps/rabbitmq_cli/test/ctl/list_policies_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_policies_command_test.exs
index c7fe20cc57..573de588c0 100644
--- a/deps/rabbitmq_cli/test/ctl/list_policies_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_policies_command_test.exs
@@ -80,11 +80,9 @@ defmodule ListPoliciesCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: 200}
- opts = %{node: target, vhost: @vhost, timeout: :infinity}
-
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag key: @key, pattern: @pattern, value: @value, vhost: @default_vhost
diff --git a/deps/rabbitmq_cli/test/ctl/list_topic_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_topic_permissions_command_test.exs
index 23b369531c..5457e4f467 100644
--- a/deps/rabbitmq_cli/test/ctl/list_topic_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_topic_permissions_command_test.exs
@@ -70,10 +70,9 @@ defmodule ListTopicPermissionsCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
- opts = %{node: target, timeout: :infinity, vhost: "/"}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag test_timeout: @default_timeout, vhost: @vhost
diff --git a/deps/rabbitmq_cli/test/ctl/list_user_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_user_permissions_command_test.exs
index b4754f372c..9baea9cb03 100644
--- a/deps/rabbitmq_cli/test/ctl/list_user_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_user_permissions_command_test.exs
@@ -74,7 +74,7 @@ defmodule ListUserPermissionsCommandTest do
## --------------------------------- Flags ------------------------------------
test "run: unreachable RabbitMQ node returns a badrpc" do
- assert @command.run(["guest"], %{node: :jake@thedog, timeout: :infinity}) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["guest"], %{node: :jake@thedog, timeout: 200}))
end
@tag test_timeout: 30000, username: "guest"
diff --git a/deps/rabbitmq_cli/test/ctl/list_user_topic_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_user_topic_permissions_command_test.exs
index 80fe979570..38d4c5fa23 100644
--- a/deps/rabbitmq_cli/test/ctl/list_user_topic_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_user_topic_permissions_command_test.exs
@@ -71,11 +71,9 @@ defmodule ListUserTopicPermissionsCommandTest do
## --------------------------------- Flags ------------------------------------
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target, timeout: :infinity}
-
- assert @command.run(["guest"], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["guest"], opts))
end
@tag test_timeout: :infinity
diff --git a/deps/rabbitmq_cli/test/ctl/list_users_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_users_command_test.exs
index c9715c2581..f741631f40 100644
--- a/deps/rabbitmq_cli/test/ctl/list_users_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_users_command_test.exs
@@ -57,7 +57,7 @@ defmodule ListUsersCommandTest do
end
test "run: On an invalid rabbitmq node, return a bad rpc" do
- assert @command.run([], %{node: :jake@thedog, timeout: :infinity}) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], %{node: :jake@thedog, timeout: 200}))
end
@tag test_timeout: 30000
@@ -82,4 +82,3 @@ defmodule ListUsersCommandTest do
=~ ~r/Listing users \.\.\./
end
end
-
diff --git a/deps/rabbitmq_cli/test/ctl/list_vhost_limits_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_vhost_limits_command_test.exs
index 929efe2351..a55144c2a3 100644
--- a/deps/rabbitmq_cli/test/ctl/list_vhost_limits_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_vhost_limits_command_test.exs
@@ -98,11 +98,9 @@ defmodule ListVhostLimitsCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- opts = %{node: target, vhost: "/"}
-
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag vhost: "bad-vhost"
diff --git a/deps/rabbitmq_cli/test/ctl/list_vhosts_command_test.exs b/deps/rabbitmq_cli/test/ctl/list_vhosts_command_test.exs
index aed18564d6..997b3422ce 100644
--- a/deps/rabbitmq_cli/test/ctl/list_vhosts_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/list_vhosts_command_test.exs
@@ -103,10 +103,9 @@ defmodule ListVhostsCommandTest do
end
test "run: on a bad RabbitMQ node, return a badrpc" do
- target = :jake@thedog
- opts = %{node: target, timeout: :infinity}
+ opts = %{node: :jake@thedog, timeout: 200}
- assert @command.run(["name"], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["name"], opts))
end
@tag test_timeout: :infinity
diff --git a/deps/rabbitmq_cli/test/ctl/node_health_check_command_test.exs b/deps/rabbitmq_cli/test/ctl/node_health_check_command_test.exs
index 52c339e04b..a821fd4ece 100644
--- a/deps/rabbitmq_cli/test/ctl/node_health_check_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/node_health_check_command_test.exs
@@ -33,7 +33,7 @@ defmodule NodeHealthCheckCommandTest do
end
setup do
- {:ok, opts: %{node: get_rabbit_hostname(), timeout: 70000}}
+ {:ok, opts: %{node: get_rabbit_hostname(), timeout: 200}}
end
test "validate: with extra arguments returns an arg count error", context do
@@ -63,11 +63,8 @@ defmodule NodeHealthCheckCommandTest do
assert @command.run([], context[:opts]) == :ok
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
-
- assert match?({:badrpc, :nodedown}, @command.run([], %{node: target, timeout: 70000}))
+ test "run: request to a non-existent node returns a badrpc" do
+ assert match?({:badrpc, _}, @command.run([], %{node: :jake@thedog, timeout: 200}))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/ping_command_test.exs b/deps/rabbitmq_cli/test/ctl/ping_command_test.exs
index 4cf917fc0c..2fae43a2f8 100644
--- a/deps/rabbitmq_cli/test/ctl/ping_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/ping_command_test.exs
@@ -33,7 +33,7 @@ defmodule PingCommandTest do
end
setup do
- {:ok, opts: %{node: get_rabbit_hostname(), timeout: 70000}}
+ {:ok, opts: %{node: get_rabbit_hostname(), timeout: 200}}
end
test "validate: with extra arguments returns an arg count error", context do
@@ -52,10 +52,8 @@ defmodule PingCommandTest do
assert @command.run([], context[:opts])
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- assert match?({:error, _}, @command.run([], %{node: target, timeout: 70000}))
+ test "run: request to a non-existent node returns a badrpc" do
+ assert match?({:error, _}, @command.run([], %{node: :jake@thedog, timeout: 200}))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/report_command_test.exs b/deps/rabbitmq_cli/test/ctl/report_command_test.exs
index 3e0cff7d7c..ded243169e 100644
--- a/deps/rabbitmq_cli/test/ctl/report_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/report_command_test.exs
@@ -41,10 +41,8 @@ defmodule ReportTest do
assert_stream_without_errors(output)
end
- test "run: report request on nonexistent RabbitMQ node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target}
+ test "run: report request on nonexistent RabbitMQ node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
assert match?({:badrpc, _}, @command.run([], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/reset_command_test.exs b/deps/rabbitmq_cli/test/ctl/reset_command_test.exs
index ad176a7254..a5207ef507 100644
--- a/deps/rabbitmq_cli/test/ctl/reset_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/reset_command_test.exs
@@ -23,13 +23,11 @@ defmodule ResetCommandTest do
setup_all do
RabbitMQ.CLI.Core.Distribution.start()
-
start_rabbitmq_app()
on_exit([], fn ->
start_rabbitmq_app()
-
end)
:ok
@@ -61,11 +59,9 @@ defmodule ResetCommandTest do
assert vhost_exists? "some_vhost"
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/restart_vhost_command_test.exs b/deps/rabbitmq_cli/test/ctl/restart_vhost_command_test.exs
index 0d14cb25fa..f5a7e38a71 100644
--- a/deps/rabbitmq_cli/test/ctl/restart_vhost_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/restart_vhost_command_test.exs
@@ -45,13 +45,10 @@ defmodule RestartVhostCommandTest do
{:validation_failure, :too_many_args}
end
- test "run: request to a non-existent node returns nodedown", _context do
- target = :jake@thedog
-
- opts = %{node: target, vhost: @vhost, timeout: @timeout}
- # We use "self" node as the target. It's enough to trigger the error.
+ test "run: request to a non-existent node returns a badrpc", _context do
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: @timeout}
assert match?(
- {:badrpc, :nodedown},
+ {:badrpc, _},
@command.run([], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/rotate_logs_command_test.exs b/deps/rabbitmq_cli/test/ctl/rotate_logs_command_test.exs
index 846afd101d..94747ead69 100644
--- a/deps/rabbitmq_cli/test/ctl/rotate_logs_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/rotate_logs_command_test.exs
@@ -39,11 +39,9 @@ defmodule RotateLogsCommandTest do
assert @command.run([], context[:opts]) == :ok
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/set_cluster_name_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_cluster_name_command_test.exs
index 8e293d3db5..3e4adce9c3 100644
--- a/deps/rabbitmq_cli/test/ctl/set_cluster_name_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_cluster_name_command_test.exs
@@ -60,10 +60,9 @@ defmodule SetClusterNameCommandTest do
end
test "run: An invalid Rabbit node returns a bad rpc message" do
- target = :jake@thedog
- opts = %{node: target}
+ opts = %{node: :jake@thedog, timeout: 200}
- assert @command.run(["clustername"], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["clustername"], opts))
end
test "banner shows that the name is being set" do
diff --git a/deps/rabbitmq_cli/test/ctl/set_global_parameter_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_global_parameter_command_test.exs
index 92e8384261..7857442f65 100644
--- a/deps/rabbitmq_cli/test/ctl/set_global_parameter_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_global_parameter_command_test.exs
@@ -62,11 +62,9 @@ defmodule SetGlobalParameterCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target}
-
- assert @command.run([@key, @value], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@key, @value], opts))
end
@tag key: @key, value: "bad-value"
diff --git a/deps/rabbitmq_cli/test/ctl/set_log_level_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_log_level_command_test.exs
index 6155420666..6c8054c203 100644
--- a/deps/rabbitmq_cli/test/ctl/set_log_level_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_log_level_command_test.exs
@@ -42,10 +42,9 @@ defmodule SetLogLevelCommandTest do
assert @command.run([context[:log_level]], context[:opts]) == :ok
end
- test "run: request to a non-existent node returns nodedown", context do
- target = :jake@thedog
- opts = %{node: target}
- assert match?({:badrpc, :nodedown}, @command.run([context[:log_level]], opts))
+ test "run: request to a non-existent node returns a badrpc", context do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([context[:log_level]], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/set_operator_policy_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_operator_policy_command_test.exs
index 3f48678a85..d6f6ed3ae0 100644
--- a/deps/rabbitmq_cli/test/ctl/set_operator_policy_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_operator_policy_command_test.exs
@@ -102,11 +102,9 @@ defmodule SetOperatorPolicyCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: "/", priority: 0, apply_to: "all", timeout: 200}
- opts = %{node: target, vhost: "/", priority: 0, apply_to: "all"}
-
- assert @command.run([@key, @pattern, @value], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@key, @pattern, @value], opts))
end
@tag pattern: @pattern, key: @key, value: @value, vhost: "bad-vhost"
diff --git a/deps/rabbitmq_cli/test/ctl/set_parameter_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_parameter_command_test.exs
index 68aa705e03..b3dd8f9309 100644
--- a/deps/rabbitmq_cli/test/ctl/set_parameter_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_parameter_command_test.exs
@@ -79,11 +79,9 @@ defmodule SetParameterCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- opts = %{node: target, vhost: "/"}
-
- assert @command.run([@component_name, @key, @value], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@component_name, @key, @value], opts))
end
@tag component_name: "bad-component-name", key: @key, value: @value, vhost: @root
diff --git a/deps/rabbitmq_cli/test/ctl/set_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_permissions_command_test.exs
index ffe52b43c1..813611f604 100644
--- a/deps/rabbitmq_cli/test/ctl/set_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_permissions_command_test.exs
@@ -81,11 +81,9 @@ defmodule SetPermissionsCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: 200}
- opts = %{node: target, vhost: @vhost}
-
- assert @command.run([@user, ".*", ".*", ".*"], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@user, ".*", ".*", ".*"], opts))
end
@tag user: "interloper", vhost: @root
diff --git a/deps/rabbitmq_cli/test/ctl/set_policy_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_policy_command_test.exs
index 4396ba6df7..be3adc1d9f 100644
--- a/deps/rabbitmq_cli/test/ctl/set_policy_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_policy_command_test.exs
@@ -104,11 +104,9 @@ defmodule SetPolicyCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: "/", priority: 0, apply_to: "all", timeout: 200}
- opts = %{node: target, vhost: "/", priority: 0, apply_to: "all"}
-
- assert @command.run([@key, @pattern, @value], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@key, @pattern, @value], opts))
end
@tag pattern: @pattern, key: @key, value: @value, vhost: "bad-vhost"
diff --git a/deps/rabbitmq_cli/test/ctl/set_topic_permissions_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_topic_permissions_command_test.exs
index e1449164dd..f7b3a52bf2 100644
--- a/deps/rabbitmq_cli/test/ctl/set_topic_permissions_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_topic_permissions_command_test.exs
@@ -81,11 +81,9 @@ defmodule SetTopicPermissionsCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: 200}
- opts = %{node: target, vhost: @vhost}
-
- assert @command.run([@user, "amq.topic", "^a", "^b"], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@user, "amq.topic", "^a", "^b"], opts))
end
@tag user: "interloper", vhost: @root
diff --git a/deps/rabbitmq_cli/test/ctl/set_user_tags_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_user_tags_command_test.exs
index eaff3c34d5..20d2d3826f 100644
--- a/deps/rabbitmq_cli/test/ctl/set_user_tags_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_user_tags_command_test.exs
@@ -49,11 +49,9 @@ defmodule SetUserTagsCommandTest do
end
test "run: throws a badrpc when instructed to contact an unreachable RabbitMQ node" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, timeout: 200}
- opts = %{node: target}
-
- assert @command.run([@user, :imperator], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@user, :imperator], opts))
end
@tag user: @user, tags: [:imperator]
diff --git a/deps/rabbitmq_cli/test/ctl/set_vhost_limits_command_test.exs b/deps/rabbitmq_cli/test/ctl/set_vhost_limits_command_test.exs
index d7e7803f6a..94fcdd322f 100644
--- a/deps/rabbitmq_cli/test/ctl/set_vhost_limits_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/set_vhost_limits_command_test.exs
@@ -87,11 +87,9 @@ defmodule SetVhostLimitsCommandTest do
end
test "run: an unreachable node throws a badrpc" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- opts = %{node: target, vhost: "/"}
-
- assert @command.run([@definition], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([@definition], opts))
end
@tag vhost: "bad-vhost"
diff --git a/deps/rabbitmq_cli/test/ctl/shutdown_command_test.exs b/deps/rabbitmq_cli/test/ctl/shutdown_command_test.exs
index c4d43a65af..a9bbfe24db 100644
--- a/deps/rabbitmq_cli/test/ctl/shutdown_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/shutdown_command_test.exs
@@ -51,10 +51,8 @@ defmodule ShutdownCommandTest do
assert @command.validate([], Map.merge(%{wait: false}, context[:opts])) == :ok
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, wait: false, timeout: 1}
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, wait: false, timeout: 200}
assert match?({:badrpc, _}, @command.run([], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/start_app_command_test.exs b/deps/rabbitmq_cli/test/ctl/start_app_command_test.exs
index cc54b7d7d3..895d68ff8a 100644
--- a/deps/rabbitmq_cli/test/ctl/start_app_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/start_app_command_test.exs
@@ -51,11 +51,9 @@ defmodule StartAppCommandTest do
assert :rabbit_misc.rpc_call(node, :rabbit, :is_running, [])
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/status_command_test.exs b/deps/rabbitmq_cli/test/ctl/status_command_test.exs
index cac3f2aab3..b9fecf283d 100644
--- a/deps/rabbitmq_cli/test/ctl/status_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/status_command_test.exs
@@ -38,11 +38,9 @@ defmodule StatusCommandTest do
assert @command.run([], context[:opts])[:pid] != nil
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, timeout: 60_000}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/stop_app_command_test.exs b/deps/rabbitmq_cli/test/ctl/stop_app_command_test.exs
index 4c76da89b7..b5cfd8e05a 100644
--- a/deps/rabbitmq_cli/test/ctl/stop_app_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/stop_app_command_test.exs
@@ -47,11 +47,9 @@ defmodule StopAppCommandTest do
refute :rabbit_misc.rpc_call(node, :rabbit, :is_running, [])
end
- test "run: request to a non-existent node returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ test "run: request to a non-existent node returns a badrpc" do
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/stop_command_test.exs b/deps/rabbitmq_cli/test/ctl/stop_command_test.exs
index b709125dfe..a48c6dc0db 100644
--- a/deps/rabbitmq_cli/test/ctl/stop_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/stop_command_test.exs
@@ -45,17 +45,13 @@ defmodule StopCommandTest do
# NB: as this commands shuts down the Erlang vm it isn't really practical to test it here
- test "run: request to a non-existent node with --idempotent=false returns nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, idempotent: false}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ test "run: request to a non-existent node with --idempotent=false returns a badrpc" do
+ opts = %{node: :jake@thedog, idempotent: false, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "run: request to a non-existent node with --idempotent returns ok" do
- target = :jake@thedog
-
- opts = %{node: target, idempotent: true}
+ opts = %{node: :jake@thedog, idempotent: true, timeout: 200}
assert match?({:ok, _}, @command.run([], opts))
end
diff --git a/deps/rabbitmq_cli/test/ctl/sync_queue_command_test.exs b/deps/rabbitmq_cli/test/ctl/sync_queue_command_test.exs
index 36cdf5a2b1..0b3f056025 100644
--- a/deps/rabbitmq_cli/test/ctl/sync_queue_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/sync_queue_command_test.exs
@@ -63,10 +63,8 @@ defmodule SyncQueueCommandTest do
end
test "run: request to a non-existent RabbitMQ node returns a nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: @vhost}
- assert match?({:badrpc, :nodedown}, @command.run(["q1"], opts))
+ opts = %{node: :jake@thedog, vhost: @vhost, timeout: 200}
+ assert match?({:badrpc, _}, @command.run(["q1"], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/ctl/trace_off_command_test.exs b/deps/rabbitmq_cli/test/ctl/trace_off_command_test.exs
index 5fe089ef52..80504fcdaa 100644
--- a/deps/rabbitmq_cli/test/ctl/trace_off_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/trace_off_command_test.exs
@@ -61,10 +61,8 @@ defmodule TraceOffCommandTest do
end
test "run: on an invalid RabbitMQ node, return a nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, vhost: "/"}
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag target: get_rabbit_hostname(), vhost: @default_vhost
diff --git a/deps/rabbitmq_cli/test/ctl/trace_on_command_test.exs b/deps/rabbitmq_cli/test/ctl/trace_on_command_test.exs
index e256fbd4df..ddd8574d6c 100644
--- a/deps/rabbitmq_cli/test/ctl/trace_on_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/trace_on_command_test.exs
@@ -61,11 +61,9 @@ defmodule TraceOnCommandTest do
end
test "run: on an invalid RabbitMQ node, return a nodedown" do
- target = :jake@thedog
+ opts = %{node: :jake@thedog, vhost: "/", timeout: 200}
- opts = %{node: target, vhost: "/"}
-
- assert @command.run([], opts) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
@tag vhost: @default_vhost
diff --git a/deps/rabbitmq_cli/test/ctl/update_cluster_nodes_command_test.exs b/deps/rabbitmq_cli/test/ctl/update_cluster_nodes_command_test.exs
index 43a3754817..3c135352a4 100644
--- a/deps/rabbitmq_cli/test/ctl/update_cluster_nodes_command_test.exs
+++ b/deps/rabbitmq_cli/test/ctl/update_cluster_nodes_command_test.exs
@@ -59,25 +59,21 @@ defmodule UpdateClusterNodesCommandTest do
start_rabbitmq_app()
end
- test "run: request to an unreachable node returns nodedown", context do
- target = :jake@thedog
-
+ test "run: request to an unreachable node returns a badrpc", context do
opts = %{
- node: target
+ node: :jake@thedog,
+ timeout: 200
}
- # We use "self" node as the target. It's enough to trigger the error.
assert match?(
{:badrpc, :nodedown},
@command.run([context[:opts][:node]], opts))
end
- test "run: specifying an unreachable node as seed returns nodedown", context do
- target = :jake@thedog
-
+ test "run: specifying an unreachable node as seed returns a badrpc", context do
stop_rabbitmq_app()
assert match?(
- {:badrpc_multi, :nodedown, [_]},
- @command.run([target], context[:opts]))
+ {:badrpc_multi, _, [_]},
+ @command.run([:jake@thedog], context[:opts]))
start_rabbitmq_app()
end
diff --git a/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs
index f820e258c1..5f521cd8aa 100644
--- a/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/check_alarms_command_test.exs
@@ -53,7 +53,7 @@ defmodule CheckAlarmsCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: when target node has no alarms in effect, returns an empty list", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs
index f0a888d234..fcb5bf1416 100644
--- a/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/check_local_alarms_command_test.exs
@@ -53,7 +53,7 @@ defmodule CheckLocalAlarmsCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: when target node has no alarms in effect, returns an empty list", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs
index ce818d6c3c..c6525a2a4f 100644
--- a/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/check_port_connectivity_command_test.exs
@@ -46,7 +46,7 @@ defmodule CheckPortConnectivityCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: tries to connect to every inferred active listener", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs
index eed32c87db..70c3b5f4dc 100644
--- a/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/check_port_listener_command_test.exs
@@ -50,7 +50,7 @@ defmodule CheckPortListenerCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([61613], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([61613], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: when a listener for the protocol is active, returns a success", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs
index 44834386aa..79608de63d 100644
--- a/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/check_protocol_listener_command_test.exs
@@ -50,7 +50,7 @@ defmodule CheckProtocolListenerCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run(["stomp"], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run(["stomp"], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: when a listener for the protocol is active, returns a success", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs
index 763639b113..6ebfa4513f 100644
--- a/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/check_running_command_test.exs
@@ -52,7 +52,7 @@ defmodule CheckRunningCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: when the RabbitMQ app is booted and started, returns true", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs
index 65487250ec..22f9462284 100644
--- a/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/cipher_suites_command_test.exs
@@ -72,7 +72,7 @@ defmodule CipherSuitesCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: returns a list of cipher suites", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs
index 160aca3045..4a603227cb 100644
--- a/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/erlang_cookie_hash_command_test.exs
@@ -47,10 +47,8 @@ defmodule ErlangCookieHashCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- target = :jake@thedog
-
- opts = %{node: target}
- assert @command.run([], Map.merge(context[:opts], opts)) == {:badrpc, :nodedown}
+ opts = %{node: :jake@thedog, timeout: 200}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], opts)))
end
test "run: returns the erlang cookie hash", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs
index f94b6efc90..4e169a41fe 100644
--- a/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/erlang_version_command_test.exs
@@ -52,7 +52,7 @@ defmodule ErlangVersionCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog, details: false})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog, details: false})))
end
test "run: returns Erlang/OTP version on the target node", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs
index cf1556b060..f53e900625 100644
--- a/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/is_booting_command_test.exs
@@ -52,7 +52,7 @@ defmodule IsBootingCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: when the RabbitMQ app is fully booted and running, returns false", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs
index 9b7b60f540..068e50844c 100644
--- a/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/is_running_command_test.exs
@@ -52,7 +52,7 @@ defmodule IsRunningCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: when the RabbitMQ app is booted and started, returns true", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs
index 96ebabfdad..aaa0049524 100644
--- a/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/listeners_command_test.exs
@@ -53,7 +53,7 @@ defmodule ListenersCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: returns a list of node-local listeners", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs
index c073ccd005..694ca6c025 100644
--- a/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/maybe_stuck_command_test.exs
@@ -48,7 +48,7 @@ defmodule MaybeStuckCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
@tag test_timeout: 0
diff --git a/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs
index a7582ce200..0a550a545d 100644
--- a/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/memory_breakdown_command_test.exs
@@ -70,10 +70,8 @@ defmodule MemoryBreakdownCommandTest do
end
test "run: request to a non-existent RabbitMQ node returns a nodedown" do
- target = :jake@thedog
-
- opts = %{node: target, timeout: 5000, unit: "gb"}
- assert match?({:badrpc, :nodedown}, @command.run([], opts))
+ opts = %{node: :jake@thedog, timeout: 200, unit: "gb"}
+ assert match?({:badrpc, _}, @command.run([], opts))
end
test "banner", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs
index 4346058d39..fd72c33eba 100644
--- a/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/runtime_thread_stats_command_test.exs
@@ -46,7 +46,7 @@ defmodule RuntimeThreadStatsCommandTest do
@tag test_timeout: 2000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
@tag test_timeout: 6000
diff --git a/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs
index ac1250eb0f..198a9147c8 100644
--- a/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/server_version_command_test.exs
@@ -47,7 +47,7 @@ defmodule ServerVersionCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run: returns RabbitMQ version on the target node", context do
diff --git a/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs
index a70481d75c..a4ff347ca9 100644
--- a/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs
+++ b/deps/rabbitmq_cli/test/diagnostics/tls_versions_command_test.exs
@@ -46,7 +46,7 @@ defmodule TlsVersionsCommandTest do
@tag test_timeout: 3000
test "run: targeting an unreachable node throws a badrpc", context do
- assert @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})) == {:badrpc, :nodedown}
+ assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog})))
end
test "run when formatter is set to JSON: return a document with a list of supported TLS versions", context do