Remove "lazy" from Management and lazy-specific tests
This commit is contained in:
parent
1a6f81b584
commit
f8a3643d5d
|
@ -117,7 +117,6 @@ _APP_ENV = """[
|
|||
|
||||
%% rabbitmq-server#973
|
||||
{queue_explicit_gc_run_operation_threshold, 1000},
|
||||
{lazy_queue_explicit_gc_run_operation_threshold, 1000},
|
||||
{background_gc_enabled, false},
|
||||
{background_gc_target_interval, 60000},
|
||||
%% rabbitmq-server#589
|
||||
|
@ -451,11 +450,6 @@ rabbitmq_integration_suite(
|
|||
],
|
||||
)
|
||||
|
||||
rabbitmq_integration_suite(
|
||||
name = "lazy_queue_SUITE",
|
||||
size = "medium",
|
||||
)
|
||||
|
||||
rabbitmq_integration_suite(
|
||||
name = "list_consumers_sanity_check_SUITE",
|
||||
size = "medium",
|
||||
|
|
|
@ -100,7 +100,6 @@ define PROJECT_ENV
|
|||
|
||||
%% rabbitmq-server#973
|
||||
{queue_explicit_gc_run_operation_threshold, 1000},
|
||||
{lazy_queue_explicit_gc_run_operation_threshold, 1000},
|
||||
{background_gc_enabled, false},
|
||||
{background_gc_target_interval, 60000},
|
||||
%% rabbitmq-server#589
|
||||
|
@ -205,7 +204,6 @@ SLOW_CT_SUITES := backing_queue \
|
|||
eager_sync \
|
||||
feature_flags \
|
||||
health_check \
|
||||
lazy_queue \
|
||||
many_node_ha \
|
||||
metrics \
|
||||
msg_store \
|
||||
|
|
|
@ -942,15 +942,6 @@ def test_suite_beam_files(name = "test_suite_beam_files"):
|
|||
app_name = "rabbit",
|
||||
erlc_opts = "//:test_erlc_opts",
|
||||
)
|
||||
erlang_bytecode(
|
||||
name = "lazy_queue_SUITE_beam_files",
|
||||
testonly = True,
|
||||
srcs = ["test/lazy_queue_SUITE.erl"],
|
||||
outs = ["test/lazy_queue_SUITE.beam"],
|
||||
app_name = "rabbit",
|
||||
erlc_opts = "//:test_erlc_opts",
|
||||
deps = ["//deps/amqp_client:erlang_app"],
|
||||
)
|
||||
erlang_bytecode(
|
||||
name = "list_consumers_sanity_check_SUITE_beam_files",
|
||||
testonly = True,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
%% This Source Code Form is subject to the terms of the Mozilla Public
|
||||
% This Source Code Form is subject to the terms of the Mozilla Public
|
||||
%% License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
%%
|
||||
|
@ -43,8 +43,6 @@
|
|||
bq_queue_index,
|
||||
bq_queue_index_props,
|
||||
{variable_queue_default, [parallel], ?VARIABLE_QUEUE_TESTCASES},
|
||||
{variable_queue_lazy, [parallel], ?VARIABLE_QUEUE_TESTCASES ++
|
||||
[variable_queue_mode_change]},
|
||||
bq_variable_queue_delete_msg_store_files_callback,
|
||||
bq_queue_recover
|
||||
]).
|
||||
|
@ -142,8 +140,6 @@ init_per_group1(backing_queue_embed_limit_1024, Config) ->
|
|||
Config;
|
||||
init_per_group1(variable_queue_default, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, {variable_queue_type, default});
|
||||
init_per_group1(variable_queue_lazy, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, {variable_queue_type, lazy});
|
||||
%% @todo These groups are no longer used?
|
||||
init_per_group1(from_cluster_node1, Config) ->
|
||||
rabbit_ct_helpers:set_config(Config, {test_direction, {0, 1}});
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
io_batch_size,
|
||||
|
||||
%% default queue or lazy queue
|
||||
%% default queue (or lazy queue from 3.6 to 3.11)
|
||||
mode,
|
||||
version = 1,
|
||||
%% Fast path for confirms handling. Instead of having
|
||||
|
|
|
@ -1,208 +0,0 @@
|
|||
%% This Source Code Form is subject to the terms of the Mozilla Public
|
||||
%% License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
%% file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
||||
%%
|
||||
%% Copyright (c) 2007-2023 VMware, Inc. or its affiliates. All rights reserved.
|
||||
%%
|
||||
|
||||
-module(lazy_queue_SUITE).
|
||||
|
||||
-include_lib("common_test/include/ct.hrl").
|
||||
-include_lib("amqp_client/include/amqp_client.hrl").
|
||||
|
||||
-compile(export_all).
|
||||
|
||||
-define(QNAME, <<"queue.mode.test">>).
|
||||
-define(MESSAGE_COUNT, 2000).
|
||||
|
||||
all() ->
|
||||
[
|
||||
{group, non_parallel_tests}
|
||||
].
|
||||
|
||||
groups() ->
|
||||
[
|
||||
{non_parallel_tests, [], [
|
||||
declare_args,
|
||||
queue_mode_policy,
|
||||
publish_consume
|
||||
]}
|
||||
].
|
||||
|
||||
%% -------------------------------------------------------------------
|
||||
%% Testsuite setup/teardown.
|
||||
%% -------------------------------------------------------------------
|
||||
|
||||
init_per_suite(Config) ->
|
||||
rabbit_ct_helpers:log_environment(),
|
||||
rabbit_ct_helpers:run_setup_steps(Config).
|
||||
|
||||
end_per_suite(Config) ->
|
||||
rabbit_ct_helpers:run_teardown_steps(Config).
|
||||
|
||||
init_per_group(_, Config) ->
|
||||
Config.
|
||||
|
||||
end_per_group(_, Config) ->
|
||||
Config.
|
||||
|
||||
init_per_testcase(Testcase, Config) ->
|
||||
rabbit_ct_helpers:testcase_started(Config, Testcase),
|
||||
ClusterSize = 2,
|
||||
TestNumber = rabbit_ct_helpers:testcase_number(Config, ?MODULE, Testcase),
|
||||
Config1 = rabbit_ct_helpers:set_config(Config, [
|
||||
{rmq_nodes_count, ClusterSize},
|
||||
{rmq_nodes_clustered, true},
|
||||
{rmq_nodename_suffix, Testcase},
|
||||
{tcp_ports_base, {skip_n_nodes, TestNumber * ClusterSize}}
|
||||
]),
|
||||
rabbit_ct_helpers:run_steps(Config1,
|
||||
rabbit_ct_broker_helpers:setup_steps() ++
|
||||
rabbit_ct_client_helpers:setup_steps() ++ [
|
||||
fun rabbit_ct_broker_helpers:set_ha_policy_all/1
|
||||
]).
|
||||
|
||||
end_per_testcase(Testcase, Config) ->
|
||||
Config1 = rabbit_ct_helpers:run_steps(Config,
|
||||
rabbit_ct_client_helpers:teardown_steps() ++
|
||||
rabbit_ct_broker_helpers:teardown_steps()),
|
||||
rabbit_ct_helpers:testcase_finished(Config1, Testcase).
|
||||
|
||||
%% -------------------------------------------------------------------
|
||||
%% Testcases.
|
||||
%% -------------------------------------------------------------------
|
||||
|
||||
declare_args(Config) ->
|
||||
A = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
|
||||
|
||||
Ch = rabbit_ct_client_helpers:open_channel(Config, A),
|
||||
LQ = <<"lazy-q">>,
|
||||
declare(Ch, LQ, [{<<"x-queue-mode">>, longstr, <<"lazy">>}]),
|
||||
assert_queue_mode(A, LQ, lazy),
|
||||
|
||||
DQ = <<"default-q">>,
|
||||
declare(Ch, DQ, [{<<"x-queue-mode">>, longstr, <<"default">>}]),
|
||||
assert_queue_mode(A, DQ, default),
|
||||
|
||||
DQ2 = <<"default-q2">>,
|
||||
declare(Ch, DQ2),
|
||||
assert_queue_mode(A, DQ2, default),
|
||||
|
||||
passed.
|
||||
|
||||
queue_mode_policy(Config) ->
|
||||
A = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
|
||||
|
||||
set_ha_mode_policy(Config, A, <<"lazy">>),
|
||||
|
||||
Ch = rabbit_ct_client_helpers:open_channel(Config, A),
|
||||
|
||||
LQ = <<"lazy-q">>,
|
||||
declare(Ch, LQ, [{<<"x-queue-mode">>, longstr, <<"lazy">>}]),
|
||||
assert_queue_mode(A, LQ, lazy),
|
||||
|
||||
LQ2 = <<"lazy-q-2">>,
|
||||
declare(Ch, LQ2),
|
||||
assert_queue_mode(A, LQ2, lazy),
|
||||
|
||||
DQ = <<"default-q">>,
|
||||
declare(Ch, DQ, [{<<"x-queue-mode">>, longstr, <<"default">>}]),
|
||||
assert_queue_mode(A, DQ, default),
|
||||
|
||||
set_ha_mode_policy(Config, A, <<"default">>),
|
||||
|
||||
ok = wait_for_queue_mode(A, LQ, lazy, 5000),
|
||||
ok = wait_for_queue_mode(A, LQ2, default, 5000),
|
||||
ok = wait_for_queue_mode(A, DQ, default, 5000),
|
||||
|
||||
passed.
|
||||
|
||||
publish_consume(Config) ->
|
||||
A = rabbit_ct_broker_helpers:get_node_config(Config, 0, nodename),
|
||||
|
||||
Ch = rabbit_ct_client_helpers:open_channel(Config, A),
|
||||
declare(Ch, ?QNAME),
|
||||
|
||||
rabbit_ct_client_helpers:publish(Ch, ?QNAME, ?MESSAGE_COUNT),
|
||||
consume(Ch, ?QNAME, ack),
|
||||
[assert_delivered(Ch, ack, P) || P <- lists:seq(1, ?MESSAGE_COUNT)],
|
||||
|
||||
set_ha_mode_policy(Config, A, <<"lazy">>),
|
||||
rabbit_ct_client_helpers:publish(Ch, ?QNAME, ?MESSAGE_COUNT),
|
||||
rabbit_ct_client_helpers:publish(Ch, ?QNAME, ?MESSAGE_COUNT),
|
||||
[assert_delivered(Ch, ack, P) || P <- lists:seq(1, ?MESSAGE_COUNT)],
|
||||
|
||||
set_ha_mode_policy(Config, A, <<"default">>),
|
||||
[assert_delivered(Ch, ack, P) || P <- lists:seq(1, ?MESSAGE_COUNT)],
|
||||
|
||||
rabbit_ct_client_helpers:publish(Ch, ?QNAME, ?MESSAGE_COUNT),
|
||||
set_ha_mode_policy(Config, A, <<"lazy">>),
|
||||
rabbit_ct_client_helpers:publish(Ch, ?QNAME, ?MESSAGE_COUNT),
|
||||
set_ha_mode_policy(Config, A, <<"default">>),
|
||||
[assert_delivered(Ch, ack, P) || P <- lists:seq(1, ?MESSAGE_COUNT)],
|
||||
|
||||
set_ha_mode_policy(Config, A, <<"lazy">>),
|
||||
[assert_delivered(Ch, ack, P) || P <- lists:seq(1, ?MESSAGE_COUNT)],
|
||||
|
||||
cancel(Ch),
|
||||
|
||||
passed.
|
||||
|
||||
%%----------------------------------------------------------------------------
|
||||
|
||||
declare(Ch, Q) ->
|
||||
declare(Ch, Q, []).
|
||||
|
||||
declare(Ch, Q, Args) ->
|
||||
amqp_channel:call(Ch, #'queue.declare'{queue = Q,
|
||||
durable = true,
|
||||
arguments = Args}).
|
||||
|
||||
consume(Ch, Q, Ack) ->
|
||||
amqp_channel:subscribe(Ch, #'basic.consume'{queue = Q,
|
||||
no_ack = Ack =:= no_ack,
|
||||
consumer_tag = <<"ctag">>},
|
||||
self()),
|
||||
receive
|
||||
#'basic.consume_ok'{consumer_tag = <<"ctag">>} ->
|
||||
ok
|
||||
end.
|
||||
|
||||
cancel(Ch) ->
|
||||
amqp_channel:call(Ch, #'basic.cancel'{consumer_tag = <<"ctag">>}).
|
||||
|
||||
assert_delivered(Ch, Ack, Payload) ->
|
||||
PBin = payload2bin(Payload),
|
||||
receive
|
||||
{#'basic.deliver'{delivery_tag = DTag}, #amqp_msg{payload = PBin2}} ->
|
||||
PBin = PBin2,
|
||||
maybe_ack(Ch, Ack, DTag)
|
||||
end.
|
||||
|
||||
maybe_ack(Ch, do_ack, DTag) ->
|
||||
amqp_channel:cast(Ch, #'basic.ack'{delivery_tag = DTag}),
|
||||
DTag;
|
||||
maybe_ack(_Ch, _, DTag) ->
|
||||
DTag.
|
||||
|
||||
payload2bin(Int) -> list_to_binary(integer_to_list(Int)).
|
||||
|
||||
set_ha_mode_policy(Config, Node, Mode) ->
|
||||
ok = rabbit_ct_broker_helpers:set_ha_policy(Config, Node, <<".*">>, <<"all">>,
|
||||
[{<<"queue-mode">>, Mode}]).
|
||||
|
||||
|
||||
wait_for_queue_mode(_, _, _, _) ->
|
||||
ok.
|
||||
|
||||
assert_queue_mode(_, _, _) ->
|
||||
ok.
|
||||
|
||||
get_queue_mode(Node, Q) ->
|
||||
QNameRes = rabbit_misc:r(<<"/">>, queue, Q),
|
||||
{ok, AMQQueue} =
|
||||
rpc:call(Node, rabbit_amqqueue, lookup, [QNameRes]),
|
||||
[{backing_queue_status, Status}] =
|
||||
rpc:call(Node, rabbit_amqqueue, info,
|
||||
[AMQQueue, [backing_queue_status]]),
|
||||
proplists:get_value(mode, Status).
|
|
@ -225,9 +225,6 @@ var HELP = {
|
|||
'queue-max-age':
|
||||
'Sets the data retention for stream queues in time units </br>(Y=Years, M=Months, D=Days, h=hours, m=minutes, s=seconds).<br/>E.g. "1h" configures the stream to only keep the last 1 hour of received messages.</br></br>(Sets the x-max-age argument.)',
|
||||
|
||||
'queue-lazy':
|
||||
'Set the queue into lazy mode, keeping as many messages as possible on disk to reduce RAM usage; if not set, the queue will keep an in-memory cache to deliver messages as fast as possible.<br/>(Sets the "<a target="_blank" href="https://www.rabbitmq.com/lazy-queues.html">x-queue-mode</a>" argument.)',
|
||||
|
||||
'queue-version':
|
||||
'Set the queue version. Defaults to version 1.<br/>Version 1 has a journal-based index that embeds small messages.<br/>Version 2 has a different index which improves memory usage and performance in many scenarios, as well as a per-queue store for messages that were previously embedded.<br/>(Sets the "x-queue-version" argument.)',
|
||||
|
||||
|
|
|
@ -118,7 +118,6 @@
|
|||
<span class="argument-link" field="definition" key="ha-promote-on-shutdown" type="string" value="">HA mirror promotion on shutdown</span> <span class="help" id="policy-ha-promote-on-shutdown"></span> |
|
||||
<span class="argument-link" field="definition" key="ha-promote-on-failure" type="string" value="">HA mirror promotion on failure</span> <span class="help" id="policy-ha-promote-on-failure"></span>
|
||||
</br>
|
||||
<span class="argument-link" field="definition" key="queue-mode" type="string" value="lazy">Lazy mode</span> |
|
||||
<span class="argument-link" field="definition" key="queue-version" type="number">Version</span> <span class="help" id="queue-version"></span> |
|
||||
<span class="argument-link" field="definition" key="queue-master-locator" type="string">Master locator</span></br>
|
||||
</td>
|
||||
|
|
|
@ -329,7 +329,6 @@
|
|||
<span class="argument-link" field="arguments" key="x-max-length-bytes" type="number">Max length bytes</span> <span class="help" id="queue-max-length-bytes"></span><br/>
|
||||
<% if (queue_type == "classic") { %>
|
||||
<span class="argument-link" field="arguments" key="x-max-priority" type="number">Maximum priority</span> <span class="help" id="queue-max-priority"></span>
|
||||
| <span class="argument-link" field="arguments" key="x-queue-mode" type="string" value="lazy">Lazy mode</span> <span class="help" id="queue-lazy"></span>
|
||||
| <span class="argument-link" field="arguments" key="x-queue-version" type="number">Version</span> <span class="help" id="queue-version"></span>
|
||||
| <span class="argument-link" field="arguments" key="x-queue-master-locator" type="string" value="">Master locator</span> <span class="help" id="queue-master-locator"></span>
|
||||
<% } %>
|
||||
|
|
Loading…
Reference in New Issue