Merge pull request #11582 from rabbitmq/testfixes-glorious-testfixes-and-other-improvements-hurray
Various test improvements
This commit is contained in:
commit
7273c6846d
|
|
@ -572,13 +572,13 @@ rabbitmq_integration_suite(
|
|||
rabbitmq_integration_suite(
|
||||
name = "per_user_connection_channel_limit_SUITE",
|
||||
size = "medium",
|
||||
shard_count = 7,
|
||||
shard_count = 4,
|
||||
)
|
||||
|
||||
rabbitmq_integration_suite(
|
||||
name = "per_user_connection_channel_tracking_SUITE",
|
||||
size = "medium",
|
||||
shard_count = 8,
|
||||
shard_count = 4,
|
||||
)
|
||||
|
||||
rabbitmq_integration_suite(
|
||||
|
|
@ -594,7 +594,7 @@ rabbitmq_integration_suite(
|
|||
rabbitmq_integration_suite(
|
||||
name = "per_vhost_connection_limit_SUITE",
|
||||
size = "medium",
|
||||
shard_count = 9,
|
||||
shard_count = 5,
|
||||
)
|
||||
|
||||
rabbitmq_integration_suite(
|
||||
|
|
|
|||
|
|
@ -20,26 +20,18 @@ suite() ->
|
|||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store},
|
||||
% {group, tests},
|
||||
{group, khepri_migration},
|
||||
{group, mnesia_cluster},
|
||||
{group, khepri_cluster}
|
||||
{group, cluster}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
[
|
||||
{mnesia_store, [], all_tests()},
|
||||
{khepri_store, [], all_tests()},
|
||||
% {tests, [], all_tests()},
|
||||
{khepri_migration, [], [
|
||||
from_mnesia_to_khepri
|
||||
]},
|
||||
{mnesia_cluster, [], [
|
||||
transient_queue_on_node_down
|
||||
]},
|
||||
{khepri_cluster, [], [
|
||||
transient_queue_on_node_down
|
||||
]}
|
||||
{cluster, [], all_tests()}
|
||||
].
|
||||
|
||||
all_tests() ->
|
||||
|
|
@ -61,7 +53,8 @@ all_tests() ->
|
|||
bind_and_unbind_exchange,
|
||||
bind_and_delete_exchange_source,
|
||||
bind_and_delete_exchange_destination,
|
||||
bind_to_unknown_exchange
|
||||
bind_to_unknown_exchange,
|
||||
transient_queue_on_node_down
|
||||
].
|
||||
|
||||
%% -------------------------------------------------------------------
|
||||
|
|
@ -75,27 +68,24 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, mnesia}]),
|
||||
init_per_group_common(Group, Config, 1);
|
||||
init_per_group(khepri_store = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, khepri}]),
|
||||
init_per_group_common(Group, Config, 1);
|
||||
init_per_group(khepri_migration = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, mnesia}]),
|
||||
init_per_group_common(Group, Config, 1);
|
||||
init_per_group(mnesia_cluster = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, mnesia}]),
|
||||
init_per_group_common(Group, Config, 3);
|
||||
init_per_group(khepri_cluster = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, khepri}]),
|
||||
% init_per_group(tests = Group, Config) ->
|
||||
% init_per_group_common(Group, Config, 1);
|
||||
init_per_group(khepri_migration = Group, Config) ->
|
||||
case rabbit_ct_broker_helpers:configured_metadata_store(Config) of
|
||||
{khepri, _} ->
|
||||
{skip, "skip khepri migration test when khepri already configured"};
|
||||
mnesia ->
|
||||
init_per_group_common(Group, Config, 1)
|
||||
end;
|
||||
init_per_group(cluster = Group, Config) ->
|
||||
init_per_group_common(Group, Config, 3).
|
||||
|
||||
init_per_group_common(Group, Config, Size) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config,
|
||||
[{rmq_nodes_count, Size},
|
||||
{rmq_nodename_suffix, Group},
|
||||
{tcp_ports_base}]),
|
||||
{tcp_ports_base, {skip_n_nodes, Size}}
|
||||
]),
|
||||
rabbit_ct_helpers:run_steps(Config1, rabbit_ct_broker_helpers:setup_steps()).
|
||||
|
||||
end_per_group(_, Config) ->
|
||||
|
|
@ -853,7 +843,8 @@ transient_queue_on_node_down(Config) ->
|
|||
rabbit_ct_broker_helpers:rpc(Config, 1, rabbit_binding, list, [<<"/">>])),
|
||||
30000),
|
||||
|
||||
rabbit_ct_broker_helpers:stop_node(Config, Server),
|
||||
|
||||
?assertEqual(ok, rabbit_control_helper:command(stop_app, Server)),
|
||||
|
||||
?awaitMatch([DirectBinding],
|
||||
lists:sort(
|
||||
|
|
@ -863,7 +854,7 @@ transient_queue_on_node_down(Config) ->
|
|||
rabbit_ct_broker_helpers:rpc(Config, 1, rabbit_amqqueue, list, [<<"/">>]),
|
||||
30000),
|
||||
|
||||
rabbit_ct_broker_helpers:start_node(Config, Server),
|
||||
?assertEqual(ok, rabbit_control_helper:command(start_app, Server)),
|
||||
|
||||
Bindings2 = lists:sort([DefaultBinding, DirectBinding]),
|
||||
?awaitMatch(Bindings2,
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
-include_lib("common_test/include/ct.hrl").
|
||||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-import(clustering_utils, [
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-import(clustering_utils, [
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@
|
|||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store},
|
||||
{group, tests},
|
||||
{group, khepri_migration}
|
||||
].
|
||||
|
||||
|
|
@ -35,7 +35,7 @@ groups() ->
|
|||
single_node_multiple_users_zero_limit
|
||||
|
||||
],
|
||||
ClusterSize2Tests = [
|
||||
ClusterSize3Tests = [
|
||||
most_basic_cluster_connection_and_channel_count,
|
||||
cluster_single_user_connection_and_channel_count,
|
||||
cluster_multiple_users_connection_and_channel_count,
|
||||
|
|
@ -49,16 +49,11 @@ groups() ->
|
|||
cluster_multiple_users_zero_limit
|
||||
],
|
||||
[
|
||||
{mnesia_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize2Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize2Tests}
|
||||
]},
|
||||
{khepri_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize2Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize2Tests}
|
||||
]},
|
||||
{tests, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize3Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize3Tests}
|
||||
]},
|
||||
{khepri_migration, [], [from_mnesia_to_khepri]}
|
||||
].
|
||||
|
||||
|
|
@ -79,10 +74,6 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, mnesia}]);
|
||||
init_per_group(khepri_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, khepri}]);
|
||||
init_per_group(khepri_migration, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, network},
|
||||
{metadata_store, mnesia}]),
|
||||
|
|
@ -96,26 +87,20 @@ init_per_group(cluster_size_3_network, Config) ->
|
|||
init_per_group(cluster_size_3_direct, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, direct}]),
|
||||
init_per_multinode_group(cluster_size_3_direct, Config1, 3);
|
||||
init_per_group(cluster_rename, Config) ->
|
||||
init_per_multinode_group(cluster_rename, Config, 2).
|
||||
init_per_group(tests, Config) ->
|
||||
Config.
|
||||
|
||||
init_per_multinode_group(Group, Config, NodeCount) ->
|
||||
init_per_multinode_group(_Group, Config, NodeCount) ->
|
||||
Suffix = rabbit_ct_helpers:testcase_absname(Config, "", "-"),
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [
|
||||
{rmq_nodes_count, NodeCount},
|
||||
{rmq_nodename_suffix, Suffix}
|
||||
]),
|
||||
case Group of
|
||||
cluster_rename ->
|
||||
% The broker is managed by {init,end}_per_testcase().
|
||||
Config1;
|
||||
_ ->
|
||||
rabbit_ct_helpers:run_steps(
|
||||
Config1, rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps())
|
||||
end.
|
||||
rabbit_ct_client_helpers:setup_steps()).
|
||||
|
||||
end_per_group(Group, Config) when Group == mnesia_store; Group == khepri_store ->
|
||||
end_per_group(tests, Config) ->
|
||||
% The broker is managed by {init,end}_per_testcase().
|
||||
Config;
|
||||
end_per_group(_Group, Config) ->
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@
|
|||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-define(A_TOUT, 20000).
|
||||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store}
|
||||
{group, tests}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
|
|
@ -36,18 +36,12 @@ groups() ->
|
|||
cluster_node_removed
|
||||
],
|
||||
[
|
||||
{mnesia_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize3Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize3Tests}
|
||||
]},
|
||||
{khepri_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize3Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize3Tests}
|
||||
]}
|
||||
{tests, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize3Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize3Tests}
|
||||
]}
|
||||
].
|
||||
|
||||
suite() ->
|
||||
|
|
@ -67,10 +61,6 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, mnesia}]);
|
||||
init_per_group(khepri_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, khepri}]);
|
||||
init_per_group(cluster_size_1_network, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, network}]),
|
||||
init_per_multinode_group(cluster_size_1_network, Config1, 1);
|
||||
|
|
@ -82,7 +72,9 @@ init_per_group(cluster_size_1_direct, Config) ->
|
|||
init_per_multinode_group(cluster_size_1_direct, Config1, 1);
|
||||
init_per_group(cluster_size_3_direct, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, direct}]),
|
||||
init_per_multinode_group(cluster_size_3_direct, Config1, 3).
|
||||
init_per_multinode_group(cluster_size_3_direct, Config1, 3);
|
||||
init_per_group(_Group, Config) ->
|
||||
Config.
|
||||
|
||||
init_per_multinode_group(_Group, Config, NodeCount) ->
|
||||
Suffix = rabbit_ct_helpers:testcase_absname(Config, "", "-"),
|
||||
|
|
@ -94,7 +86,7 @@ init_per_multinode_group(_Group, Config, NodeCount) ->
|
|||
Config1, rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()).
|
||||
|
||||
end_per_group(Group, Config) when Group == mnesia_store; Group == khepri_store ->
|
||||
end_per_group(tests, Config) ->
|
||||
% The broker is managed by {init,end}_per_testcase().
|
||||
Config;
|
||||
end_per_group(_Group, Config) ->
|
||||
|
|
|
|||
|
|
@ -12,14 +12,14 @@
|
|||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-define(AWAIT_TIMEOUT, 30000).
|
||||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store}
|
||||
{group, tests}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
|
|
@ -31,18 +31,12 @@ groups() ->
|
|||
cluster_user_deletion_forces_connection_closure
|
||||
],
|
||||
[
|
||||
{mnesia_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_2_network, [], ClusterSize2Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_2_direct, [], ClusterSize2Tests}
|
||||
]},
|
||||
{khepri_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_2_network, [], ClusterSize2Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_2_direct, [], ClusterSize2Tests}
|
||||
]}
|
||||
{tests, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_2_network, [], ClusterSize2Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_2_direct, [], ClusterSize2Tests}
|
||||
]}
|
||||
].
|
||||
|
||||
suite() ->
|
||||
|
|
@ -62,10 +56,6 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, mnesia}]);
|
||||
init_per_group(khepri_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, khepri}]);
|
||||
init_per_group(cluster_size_1_network, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, network}]),
|
||||
init_per_multinode_group(cluster_size_1_network, Config1, 1);
|
||||
|
|
@ -77,7 +67,9 @@ init_per_group(cluster_size_1_direct, Config) ->
|
|||
init_per_multinode_group(cluster_size_1_direct, Config1, 1);
|
||||
init_per_group(cluster_size_2_direct, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, direct}]),
|
||||
init_per_multinode_group(cluster_size_2_direct, Config1, 2).
|
||||
init_per_multinode_group(cluster_size_2_direct, Config1, 2);
|
||||
init_per_group(tests, Config) ->
|
||||
Config.
|
||||
|
||||
init_per_multinode_group(_Group, Config, NodeCount) ->
|
||||
Suffix = rabbit_ct_helpers:testcase_absname(Config, "", "-"),
|
||||
|
|
@ -89,7 +81,7 @@ init_per_multinode_group(_Group, Config, NodeCount) ->
|
|||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()).
|
||||
|
||||
end_per_group(Group, Config) when Group == mnesia_store; Group == khepri_store ->
|
||||
end_per_group(tests, Config) ->
|
||||
% The broker is managed by {init,end}_per_testcase().
|
||||
Config;
|
||||
end_per_group(_Group, Config) ->
|
||||
|
|
|
|||
|
|
@ -12,12 +12,12 @@
|
|||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store},
|
||||
{group, tests},
|
||||
{group, khepri_migration}
|
||||
].
|
||||
|
||||
|
|
@ -46,18 +46,12 @@ groups() ->
|
|||
cluster_multiple_vhosts_zero_limit
|
||||
],
|
||||
[
|
||||
{mnesia_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize3Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize3Tests}
|
||||
]},
|
||||
{khepri_store, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize3Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize3Tests}
|
||||
]},
|
||||
{tests, [], [
|
||||
{cluster_size_1_network, [], ClusterSize1Tests},
|
||||
{cluster_size_3_network, [], ClusterSize3Tests},
|
||||
{cluster_size_1_direct, [], ClusterSize1Tests},
|
||||
{cluster_size_3_direct, [], ClusterSize3Tests}
|
||||
]},
|
||||
{khepri_migration, [], [from_mnesia_to_khepri]}
|
||||
].
|
||||
|
||||
|
|
@ -68,7 +62,6 @@ suite() ->
|
|||
].
|
||||
|
||||
%% see partitions_SUITE
|
||||
-define(DELAY, 9000).
|
||||
-define(AWAIT, 1000).
|
||||
-define(INTERVAL, 250).
|
||||
|
||||
|
|
@ -83,10 +76,6 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, mnesia}]);
|
||||
init_per_group(khepri_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, khepri}]);
|
||||
init_per_group(khepri_migration, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, network},
|
||||
{metadata_store, mnesia}]),
|
||||
|
|
@ -102,7 +91,9 @@ init_per_group(cluster_size_1_direct, Config) ->
|
|||
init_per_multinode_group(cluster_size_1_direct, Config1, 1);
|
||||
init_per_group(cluster_size_3_direct, Config) ->
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [{connection_type, direct}]),
|
||||
init_per_multinode_group(cluster_size_3_direct, Config1, 3).
|
||||
init_per_multinode_group(cluster_size_3_direct, Config1, 3);
|
||||
init_per_group(tests, Config) ->
|
||||
Config.
|
||||
|
||||
init_per_multinode_group(_Group, Config, NodeCount) ->
|
||||
Suffix = rabbit_ct_helpers:testcase_absname(Config, "", "-"),
|
||||
|
|
@ -114,8 +105,8 @@ init_per_multinode_group(_Group, Config, NodeCount) ->
|
|||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()).
|
||||
|
||||
end_per_group(Group, Config) when Group == mnesia_store;
|
||||
Group == khepri_store; Group == khepri_migration ->
|
||||
end_per_group(Group, Config) when Group == tests;
|
||||
Group == khepri_migration ->
|
||||
% The broker is managed by {init,end}_per_testcase().
|
||||
Config;
|
||||
end_per_group(_Group, Config) ->
|
||||
|
|
|
|||
|
|
@ -7,10 +7,10 @@
|
|||
|
||||
-module(per_vhost_connection_limit_partitions_SUITE).
|
||||
|
||||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-import(rabbit_ct_client_helpers, [open_unmanaged_connection/2,
|
||||
|
|
|
|||
|
|
@ -11,20 +11,19 @@
|
|||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-define(MSGS_COUNT, 100).
|
||||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store}
|
||||
{group, tests}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
[
|
||||
{mnesia_store, [], all_tests()},
|
||||
{khepri_store, [], all_tests()}
|
||||
{tests, [], all_tests()}
|
||||
].
|
||||
|
||||
all_tests() ->
|
||||
|
|
@ -39,11 +38,7 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, khepri}]),
|
||||
init_per_group_common(Config);
|
||||
init_per_group(khepri_store, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, khepri}]),
|
||||
init_per_group(tests, Config) ->
|
||||
init_per_group_common(Config).
|
||||
|
||||
init_per_group_common(Config) ->
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@
|
|||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-import(rabbit_ct_client_helpers, [open_unmanaged_connection/3,
|
||||
|
|
@ -21,20 +22,15 @@
|
|||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store}
|
||||
{group, tests}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
[
|
||||
{mnesia_store, [], [
|
||||
{cluster_size_1, [], cluster_size_1_tests()},
|
||||
{cluster_size_2, [], cluster_size_2_tests()}
|
||||
]},
|
||||
{khepri_store, [], [
|
||||
{cluster_size_1, [], cluster_size_1_tests()},
|
||||
{cluster_size_2, [], cluster_size_2_tests()}
|
||||
]}
|
||||
{tests, [], [
|
||||
{cluster_size_1, [], cluster_size_1_tests()},
|
||||
{cluster_size_2, [], cluster_size_2_tests()}
|
||||
]}
|
||||
].
|
||||
|
||||
cluster_size_1_tests() ->
|
||||
|
|
@ -78,10 +74,8 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, mnesia}]);
|
||||
init_per_group(khepri_store, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, [{metadata_store, khepri}]);
|
||||
init_per_group(tests, Config) ->
|
||||
Config;
|
||||
init_per_group(cluster_size_1 = Group, Config) ->
|
||||
init_per_multinode_group(Group, Config, 1);
|
||||
init_per_group(cluster_size_2 = Group, Config) ->
|
||||
|
|
@ -97,7 +91,7 @@ init_per_multinode_group(_Group, Config, NodeCount) ->
|
|||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()).
|
||||
|
||||
end_per_group(Group, Config) when Group == mnesia_store; Group == khepri_store ->
|
||||
end_per_group(tests, Config) ->
|
||||
Config;
|
||||
end_per_group(_Group, Config) ->
|
||||
rabbit_ct_helpers:run_steps(Config,
|
||||
|
|
|
|||
|
|
@ -13,19 +13,18 @@
|
|||
-include_lib("stdlib/include/assert.hrl").
|
||||
-include_lib("rabbitmq_ct_helpers/include/rabbit_assert.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store},
|
||||
{group, tests},
|
||||
{group, khepri_migration}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
[
|
||||
{mnesia_store, [], all_tests()},
|
||||
{khepri_store, [], all_tests()},
|
||||
{tests, [], all_tests()},
|
||||
{khepri_migration, [], [
|
||||
from_mnesia_to_khepri
|
||||
]}
|
||||
|
|
@ -62,11 +61,7 @@ init_per_suite(Config) ->
|
|||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(mnesia_store = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, mnesia}]),
|
||||
init_per_group_common(Group, Config, 2);
|
||||
init_per_group(khepri_store = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, khepri}]),
|
||||
init_per_group(tests = Group, Config) ->
|
||||
init_per_group_common(Group, Config, 2);
|
||||
init_per_group(khepri_migration = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, mnesia}]),
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
-include_lib("eunit/include/eunit.hrl").
|
||||
|
||||
-compile(nowarn_export_all).
|
||||
-compile(export_all).
|
||||
|
||||
-define(TIMEOUT, 60000).
|
||||
|
|
@ -18,8 +19,7 @@
|
|||
|
||||
all() ->
|
||||
[
|
||||
{group, mnesia_store},
|
||||
{group, khepri_store}
|
||||
{group, tests}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
|
|
@ -33,13 +33,7 @@ groups() ->
|
|||
confirm_mandatory_unroutable,
|
||||
confirm_unroutable_message],
|
||||
[
|
||||
{mnesia_store, [],
|
||||
[
|
||||
{classic_queue, [parallel], PublisherConfirmTests ++ [confirm_nack]},
|
||||
{quorum_queue, [parallel], PublisherConfirmTests},
|
||||
{quorum_queue, [], [confirm_minority]}
|
||||
]},
|
||||
{khepri_store, [],
|
||||
{tests, [],
|
||||
[
|
||||
{classic_queue, [parallel], PublisherConfirmTests ++ [confirm_nack]},
|
||||
{quorum_queue, [parallel], PublisherConfirmTests}
|
||||
|
|
@ -72,28 +66,20 @@ init_per_group(quorum_queue, Config) ->
|
|||
Config,
|
||||
[{queue_args, [{<<"x-queue-type">>, longstr, <<"quorum">>}]},
|
||||
{queue_durable, true}]);
|
||||
init_per_group(mnesia_store = Group, Config0) ->
|
||||
init_per_group(Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, mnesia}]),
|
||||
init_per_group0(Group, Config);
|
||||
init_per_group(khepri_store = Group, Config0) ->
|
||||
Config = rabbit_ct_helpers:set_config(Config0, [{metadata_store, khepri}]),
|
||||
init_per_group0(Group, Config).
|
||||
|
||||
init_per_group0(Group, Config) ->
|
||||
case lists:member({group, Group}, all()) of
|
||||
true ->
|
||||
ClusterSize = 3,
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [
|
||||
{rmq_nodename_suffix, Group},
|
||||
{rmq_nodes_count, ClusterSize}
|
||||
]),
|
||||
Config2 = rabbit_ct_helpers:run_steps(Config1,
|
||||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()),
|
||||
Config2;
|
||||
false ->
|
||||
Config
|
||||
end.
|
||||
ClusterSize = 3,
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [
|
||||
{rmq_nodename_suffix, Group},
|
||||
{rmq_nodes_count, ClusterSize}
|
||||
]),
|
||||
Config2 = rabbit_ct_helpers:run_steps(Config1,
|
||||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps()),
|
||||
Config2.
|
||||
|
||||
end_per_group(Group, Config) ->
|
||||
case lists:member({group, Group}, all()) of
|
||||
|
|
@ -285,17 +271,14 @@ confirm_nack1(Config) ->
|
|||
#'confirm.select_ok'{} -> ok
|
||||
after ?TIMEOUT -> throw(failed_to_enable_confirms)
|
||||
end,
|
||||
%% stop the queue
|
||||
ok = gen_server:stop(QPid1, shutdown, 5000),
|
||||
%% Publish a message
|
||||
rabbit_channel:do(Ch, #'basic.publish'{exchange = <<"amq.direct">>,
|
||||
routing_key = <<"confirms-magic">>
|
||||
},
|
||||
rabbit_basic:build_content(
|
||||
#'P_basic'{delivery_mode = 2}, <<"">>)),
|
||||
%% We must not kill the queue before the channel has processed the
|
||||
%% 'publish'.
|
||||
ok = rabbit_channel:flush(Ch),
|
||||
%% Crash the queue
|
||||
QPid1 ! boom,
|
||||
%% Wait for a nack
|
||||
receive
|
||||
#'basic.nack'{} -> ok;
|
||||
|
|
@ -311,35 +294,6 @@ confirm_nack1(Config) ->
|
|||
ok = rabbit_channel:shutdown(Ch),
|
||||
passed.
|
||||
|
||||
%% The closest to a nack behaviour that we can get on quorum queues is not answering while
|
||||
%% the cluster is in minority. Once the cluster recovers, a 'basic.ack' will be issued.
|
||||
confirm_minority(Config) ->
|
||||
[_A, B, C] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename),
|
||||
{_Conn, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0),
|
||||
QName = ?config(queue_name, Config),
|
||||
declare_queue(Ch, Config, QName),
|
||||
ok = rabbit_ct_broker_helpers:stop_node(Config, B),
|
||||
ok = rabbit_ct_broker_helpers:stop_node(Config, C),
|
||||
amqp_channel:call(Ch, #'confirm.select'{}),
|
||||
amqp_channel:register_confirm_handler(Ch, self()),
|
||||
publish(Ch, QName, [<<"msg1">>]),
|
||||
receive
|
||||
#'basic.nack'{} -> ok;
|
||||
#'basic.ack'{} -> throw(unexpected_ack)
|
||||
after 120000 ->
|
||||
ok
|
||||
end,
|
||||
ok = rabbit_ct_broker_helpers:start_node(Config, B),
|
||||
publish(Ch, QName, [<<"msg2">>]),
|
||||
receive
|
||||
#'basic.nack'{} -> throw(unexpected_nack);
|
||||
#'basic.ack'{} ->
|
||||
ok
|
||||
after 60000 ->
|
||||
throw(missing_ack)
|
||||
end,
|
||||
ok = rabbit_ct_broker_helpers:start_node(Config, C),
|
||||
ok.
|
||||
|
||||
%%%%%%%%%%%%%%%%%%%%%%%%
|
||||
%% Test helpers
|
||||
|
|
|
|||
|
|
@ -35,9 +35,13 @@ groups() ->
|
|||
].
|
||||
|
||||
init_per_suite(Config0) ->
|
||||
Tick = 256,
|
||||
rabbit_ct_helpers:log_environment(),
|
||||
Config = rabbit_ct_helpers:merge_app_env(
|
||||
Config0, {rabbit, [{quorum_tick_interval, 1000}]}),
|
||||
Config0, {rabbit, [
|
||||
{quorum_tick_interval, Tick},
|
||||
{stream_tick_interval, Tick}
|
||||
]}),
|
||||
rabbit_ct_helpers:run_setup_steps(Config).
|
||||
|
||||
end_per_suite(Config) ->
|
||||
|
|
@ -49,10 +53,12 @@ init_per_group(Group, Config) ->
|
|||
Config1 = rabbit_ct_helpers:set_config(Config,
|
||||
[{rmq_nodes_count, ClusterSize},
|
||||
{rmq_nodename_suffix, Group},
|
||||
{tcp_ports_base}]),
|
||||
{tcp_ports_base, {skip_n_nodes, ClusterSize}}
|
||||
]),
|
||||
Config1b = rabbit_ct_helpers:set_config(Config1,
|
||||
[{queue_type, atom_to_binary(Group, utf8)},
|
||||
{net_ticktime, 10}]),
|
||||
{net_ticktime, 5}
|
||||
]),
|
||||
Config2 = rabbit_ct_helpers:run_steps(Config1b,
|
||||
[fun merge_app_env/1 ] ++
|
||||
rabbit_ct_broker_helpers:setup_steps()),
|
||||
|
|
|
|||
|
|
@ -492,9 +492,9 @@ add_replicas(Config) ->
|
|||
#'confirm.select_ok'{} = amqp_channel:call(Ch, #'confirm.select'{}),
|
||||
amqp_channel:register_confirm_handler(Ch, self()),
|
||||
[publish(Ch, Q, Data) || _ <- lists:seq(1, NumMsgs)],
|
||||
%% should be sufficient sleepage for the next message to fall in the next
|
||||
%% chunk
|
||||
timer:sleep(10),
|
||||
%% wait for confirms here to ensure the next message ends up in a chunk
|
||||
%% of it's own
|
||||
amqp_channel:wait_for_confirms(Ch, 30),
|
||||
publish(Ch, Q, <<"last">>),
|
||||
amqp_channel:wait_for_confirms(Ch, 30),
|
||||
?assertEqual(ok,
|
||||
|
|
|
|||
Loading…
Reference in New Issue