diff options
| author | Michael Klishin <mklishin@pivotal.io> | 2020-04-11 09:02:37 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-11 09:02:37 +0300 |
| commit | ce78c6a36ff3bc0f03b7b025d57523e2db9874cb (patch) | |
| tree | 6f337656574aa04b1abd7d59ac837fba43405e2f /test | |
| parent | ab6111ba499519c99123310cf5f308e045e26e96 (diff) | |
| parent | 9aced82a5bdf25aa9819556e8ee1f5134668af18 (diff) | |
| download | rabbitmq-server-git-ce78c6a36ff3bc0f03b7b025d57523e2db9874cb.tar.gz | |
Merge pull request #2308 from rabbitmq/remove-flaky-tests
Remove flaky tests
Diffstat (limited to 'test')
| -rw-r--r-- | test/backing_queue_SUITE.erl | 40 | ||||
| -rw-r--r-- | test/confirms_rejects_SUITE.erl | 99 | ||||
| -rw-r--r-- | test/publisher_confirms_parallel_SUITE.erl | 45 | ||||
| -rw-r--r-- | test/queue_master_location_SUITE.erl | 11 | ||||
| -rw-r--r-- | test/simple_ha_SUITE.erl | 54 | ||||
| -rw-r--r-- | test/unit_gm_SUITE.erl | 26 |
6 files changed, 40 insertions, 235 deletions
diff --git a/test/backing_queue_SUITE.erl b/test/backing_queue_SUITE.erl index 40f344324d..49e53c6c01 100644 --- a/test/backing_queue_SUITE.erl +++ b/test/backing_queue_SUITE.erl @@ -42,7 +42,6 @@ variable_queue_purge, variable_queue_requeue, variable_queue_requeue_ram_beta, - variable_queue_fold, variable_queue_batch_publish, variable_queue_batch_publish_delivered ]). @@ -176,8 +175,7 @@ orelse Group =:= backing_queue_embed_limit_1024 -> end_per_group1(_, Config) -> Config. -init_per_testcase(Testcase, Config) when Testcase == variable_queue_requeue; - Testcase == variable_queue_fold -> +init_per_testcase(Testcase, Config) when Testcase == variable_queue_requeue -> ok = rabbit_ct_broker_helpers:rpc( Config, 0, application, set_env, [rabbit, queue_explicit_gc_run_operation_threshold, 0]), @@ -185,8 +183,7 @@ init_per_testcase(Testcase, Config) when Testcase == variable_queue_requeue; init_per_testcase(Testcase, Config) -> rabbit_ct_helpers:testcase_started(Config, Testcase). -end_per_testcase(Testcase, Config) when Testcase == variable_queue_requeue; - Testcase == variable_queue_fold -> +end_per_testcase(Testcase, Config) when Testcase == variable_queue_requeue -> ok = rabbit_ct_broker_helpers:rpc( Config, 0, application, set_env, [rabbit, queue_explicit_gc_run_operation_threshold, 1000]), @@ -1150,39 +1147,6 @@ variable_queue_requeue_ram_beta2(VQ0, _Config) -> {_, VQ8} = rabbit_variable_queue:ack(AcksAll, VQ7), VQ8. -variable_queue_fold(Config) -> - passed = rabbit_ct_broker_helpers:rpc(Config, 0, - ?MODULE, variable_queue_fold1, [Config]). - -variable_queue_fold1(Config) -> - with_fresh_variable_queue( - fun variable_queue_fold2/2, - ?config(variable_queue_type, Config)). - -variable_queue_fold2(VQ0, _Config) -> - {PendingMsgs, RequeuedMsgs, FreshMsgs, VQ1} = - variable_queue_with_holes(VQ0), - Count = rabbit_variable_queue:depth(VQ1), - Msgs = lists:sort(PendingMsgs ++ RequeuedMsgs ++ FreshMsgs), - lists:foldl(fun (Cut, VQ2) -> - test_variable_queue_fold(Cut, Msgs, PendingMsgs, VQ2) - end, VQ1, [0, 1, 2, Count div 2, - Count - 1, Count, Count + 1, Count * 2]). - -test_variable_queue_fold(Cut, Msgs, PendingMsgs, VQ0) -> - {Acc, VQ1} = rabbit_variable_queue:fold( - fun (M, _, Pending, A) -> - MInt = msg2int(M), - Pending = lists:member(MInt, PendingMsgs), %% assert - case MInt =< Cut of - true -> {cont, [MInt | A]}; - false -> {stop, A} - end - end, [], VQ0), - Expected = lists:takewhile(fun (I) -> I =< Cut end, Msgs), - Expected = lists:reverse(Acc), %% assertion - VQ1. - variable_queue_batch_publish(Config) -> passed = rabbit_ct_broker_helpers:rpc(Config, 0, ?MODULE, variable_queue_batch_publish1, [Config]). diff --git a/test/confirms_rejects_SUITE.erl b/test/confirms_rejects_SUITE.erl index 402bca8737..56d95df878 100644 --- a/test/confirms_rejects_SUITE.erl +++ b/test/confirms_rejects_SUITE.erl @@ -18,9 +18,7 @@ groups() -> [ {parallel_tests, [parallel], [ {overflow_reject_publish_dlx, [parallel], OverflowTests}, - {overflow_reject_publish, [parallel], OverflowTests}, - dead_queue_rejects, - mixed_dead_alive_queues_reject + {overflow_reject_publish, [parallel], OverflowTests} ]} ]. @@ -64,9 +62,7 @@ init_per_testcase(policy_resets_to_default = Testcase, Config) -> rabbit_ct_helpers:testcase_started( rabbit_ct_helpers:set_config(Config, [{conn, Conn}]), Testcase); init_per_testcase(Testcase, Config) - when Testcase == confirms_rejects_conflict; - Testcase == dead_queue_rejects; - Testcase == mixed_dead_alive_queues_reject -> + when Testcase == confirms_rejects_conflict -> Conn = rabbit_ct_client_helpers:open_unmanaged_connection(Config), Conn1 = rabbit_ct_client_helpers:open_unmanaged_connection(Config), @@ -91,16 +87,6 @@ end_per_testcase(confirms_rejects_conflict = Testcase, Config) -> XOverflow = ?config(overflow, Config), QueueName = <<"confirms_rejects_conflict", "_", XOverflow/binary>>, amqp_channel:call(Ch, #'queue.delete'{queue = QueueName}), - end_per_testcase0(Testcase, Config); -end_per_testcase(dead_queue_rejects = Testcase, Config) -> - {_, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0), - amqp_channel:call(Ch, #'queue.delete'{queue = <<"dead_queue_rejects">>}), - end_per_testcase0(Testcase, Config); -end_per_testcase(mixed_dead_alive_queues_reject = Testcase, Config) -> - {_, Ch} = rabbit_ct_client_helpers:open_connection_and_channel(Config, 0), - amqp_channel:call(Ch, #'queue.delete'{queue = <<"mixed_dead_alive_queues_reject_dead">>}), - amqp_channel:call(Ch, #'queue.delete'{queue = <<"mixed_dead_alive_queues_reject_alive">>}), - amqp_channel:call(Ch, #'exchange.delete'{exchange = <<"mixed_dead_alive_queues_reject">>}), end_per_testcase0(Testcase, Config). end_per_testcase0(Testcase, Config) -> @@ -116,87 +102,6 @@ end_per_testcase0(Testcase, Config) -> rabbit_ct_helpers:testcase_finished(Config, Testcase). -dead_queue_rejects(Config) -> - Conn = ?config(conn, Config), - {ok, Ch} = amqp_connection:open_channel(Conn), - QueueName = <<"dead_queue_rejects">>, - amqp_channel:call(Ch, #'confirm.select'{}), - amqp_channel:register_confirm_handler(Ch, self()), - - amqp_channel:call(Ch, #'queue.declare'{queue = QueueName, - durable = true}), - - amqp_channel:call(Ch, #'basic.publish'{routing_key = QueueName}, - #amqp_msg{payload = <<"HI">>}), - - receive - {'basic.ack',_,_} -> ok - after 10000 -> - error(timeout_waiting_for_initial_ack) - end, - - kill_the_queue(QueueName, Config), - - amqp_channel:call(Ch, #'basic.publish'{routing_key = QueueName}, - #amqp_msg{payload = <<"HI">>}), - - receive - {'basic.ack',_,_} -> error(expecting_nack_got_ack); - {'basic.nack',_,_,_} -> ok - after 10000 -> - error(timeout_waiting_for_nack) - end. - -mixed_dead_alive_queues_reject(Config) -> - Conn = ?config(conn, Config), - {ok, Ch} = amqp_connection:open_channel(Conn), - QueueNameDead = <<"mixed_dead_alive_queues_reject_dead">>, - QueueNameAlive = <<"mixed_dead_alive_queues_reject_alive">>, - ExchangeName = <<"mixed_dead_alive_queues_reject">>, - - amqp_channel:call(Ch, #'confirm.select'{}), - amqp_channel:register_confirm_handler(Ch, self()), - - amqp_channel:call(Ch, #'queue.declare'{queue = QueueNameDead, - durable = true}), - amqp_channel:call(Ch, #'queue.declare'{queue = QueueNameAlive, - durable = true}), - - amqp_channel:call(Ch, #'exchange.declare'{exchange = ExchangeName, - durable = true}), - - amqp_channel:call(Ch, #'queue.bind'{exchange = ExchangeName, - queue = QueueNameAlive, - routing_key = <<"route">>}), - - amqp_channel:call(Ch, #'queue.bind'{exchange = ExchangeName, - queue = QueueNameDead, - routing_key = <<"route">>}), - - amqp_channel:call(Ch, #'basic.publish'{exchange = ExchangeName, - routing_key = <<"route">>}, - #amqp_msg{payload = <<"HI">>}), - - receive - {'basic.ack',_,_} -> ok; - {'basic.nack',_,_,_} -> error(expecting_ack_got_nack) - after 50000 -> - error({timeout_waiting_for_initial_ack, process_info(self(), messages)}) - end, - - kill_the_queue(QueueNameDead, Config), - - amqp_channel:call(Ch, #'basic.publish'{exchange = ExchangeName, - routing_key = <<"route">>}, - #amqp_msg{payload = <<"HI">>}), - - receive - {'basic.nack',_,_,_} -> ok; - {'basic.ack',_,_} -> error(expecting_nack_got_ack) - after 50000 -> - error({timeout_waiting_for_nack, process_info(self(), messages)}) - end. - confirms_rejects_conflict(Config) -> Conn = ?config(conn, Config), Conn1 = ?config(conn1, Config), diff --git a/test/publisher_confirms_parallel_SUITE.erl b/test/publisher_confirms_parallel_SUITE.erl index 8e90452b0d..824760e9e5 100644 --- a/test/publisher_confirms_parallel_SUITE.erl +++ b/test/publisher_confirms_parallel_SUITE.erl @@ -35,20 +35,43 @@ all() -> ]. groups() -> - PublisherConfirmTests = [publisher_confirms, - publisher_confirms_with_deleted_queue, - confirm_select_ok, - confirm_nowait, - confirm_ack, - confirm_acks, - confirm_mandatory_unroutable, - confirm_unroutable_message], [ {publisher_confirm_tests, [], [ - {classic_queue, [parallel], PublisherConfirmTests ++ [confirm_nack]}, - {mirrored_queue, [parallel], PublisherConfirmTests ++ [confirm_nack]}, - {quorum_queue, [parallel], PublisherConfirmTests ++ [confirm_minority]} + {classic_queue, + [parallel], + [publisher_confirms, + publisher_confirms_with_deleted_queue, + confirm_select_ok, + confirm_nowait, + confirm_ack, + confirm_acks, + confirm_mandatory_unroutable, + confirm_unroutable_message, + confirm_nack] + }, + {mirrored_queue, + [parallel], + [publisher_confirms_with_deleted_queue, + confirm_select_ok, + confirm_nowait, + confirm_ack, + confirm_acks, + confirm_mandatory_unroutable, + confirm_unroutable_message] + }, + {quorum_queue, + [parallel], + [publisher_confirms, + publisher_confirms_with_deleted_queue, + confirm_select_ok, + confirm_nowait, + confirm_ack, + confirm_acks, + confirm_mandatory_unroutable, + confirm_unroutable_message, + confirm_minority] + } ]} ]. diff --git a/test/queue_master_location_SUITE.erl b/test/queue_master_location_SUITE.erl index 694b2e5d11..1049a263c8 100644 --- a/test/queue_master_location_SUITE.erl +++ b/test/queue_master_location_SUITE.erl @@ -58,8 +58,7 @@ groups() -> declare_config, calculate_min_master, calculate_min_master_with_bindings, - calculate_random, - calculate_client_local + calculate_random ]} ]. @@ -249,14 +248,6 @@ calculate_random(Config) -> verify_random(Config, Q), ok. -calculate_client_local(Config) -> - setup_test_environment(Config), - QueueName = rabbit_misc:r(<<"/">>, queue, Q = <<"qm.test">>), - Args = [{<<"x-queue-master-locator">>, longstr, <<"client-local">>}], - declare(Config, QueueName, false, false, Args, none), - verify_client_local(Config, Q), - ok. - %% %% Setup environment %% diff --git a/test/simple_ha_SUITE.erl b/test/simple_ha_SUITE.erl index 567f43fe67..5eae4b062c 100644 --- a/test/simple_ha_SUITE.erl +++ b/test/simple_ha_SUITE.erl @@ -31,10 +31,6 @@ all() -> ]. groups() -> - RejectTests = [ - rejects_survive_stop, - rejects_survive_policy - ], [ {cluster_size_2, [], [ rapid_redeclare, @@ -47,10 +43,7 @@ groups() -> consume_survives_policy, auto_resume, auto_resume_no_ccn_client, - confirms_survive_stop, - confirms_survive_policy, - {overflow_reject_publish, [], RejectTests}, - {overflow_reject_publish_dlx, [], RejectTests} + confirms_survive_stop ]} ]. @@ -72,14 +65,6 @@ init_per_group(cluster_size_2, Config) -> init_per_group(cluster_size_3, Config) -> rabbit_ct_helpers:set_config(Config, [ {rmq_nodes_count, 3} - ]); -init_per_group(overflow_reject_publish, Config) -> - rabbit_ct_helpers:set_config(Config, [ - {overflow, <<"reject-publish">>} - ]); -init_per_group(overflow_reject_publish_dlx, Config) -> - rabbit_ct_helpers:set_config(Config, [ - {overflow, <<"reject-publish-dlx">>} ]). end_per_group(_, Config) -> @@ -204,10 +189,6 @@ auto_resume_no_ccn_client(Cf) -> consume_survives(Cf, fun sigkill/2, false, false). confirms_survive_stop(Cf) -> confirms_survive(Cf, fun stop/2). -confirms_survive_policy(Cf) -> confirms_survive(Cf, fun policy/2). - -rejects_survive_stop(Cf) -> rejects_survive(Cf, fun stop/2). -rejects_survive_policy(Cf) -> rejects_survive(Cf, fun policy/2). %%---------------------------------------------------------------------------- @@ -266,39 +247,6 @@ confirms_survive(Config, DeathFun) -> rabbit_ha_test_producer:await_response(ProducerPid), ok. -rejects_survive(Config, DeathFun) -> - [A, B, _] = rabbit_ct_broker_helpers:get_node_configs(Config, nodename), - Msgs = rabbit_ct_helpers:cover_work_factor(Config, 20000), - Node1Channel = rabbit_ct_client_helpers:open_channel(Config, A), - Node2Channel = rabbit_ct_client_helpers:open_channel(Config, B), - - %% declare the queue on the master, mirrored to the two slaves - XOverflow = ?config(overflow, Config), - Queue = <<"test_rejects", "_", XOverflow/binary>>, - amqp_channel:call(Node1Channel,#'queue.declare'{queue = Queue, - auto_delete = false, - durable = true, - arguments = [{<<"x-max-length">>, long, 1}, - {<<"x-overflow">>, longstr, XOverflow}]}), - Payload = <<"there can be only one">>, - amqp_channel:call(Node1Channel, - #'basic.publish'{routing_key = Queue}, - #amqp_msg{payload = Payload}), - - %% send a bunch of messages from the producer. Tolerating nacks. - ProducerPid = rabbit_ha_test_producer:create(Node2Channel, Queue, - self(), true, Msgs, nacks), - DeathFun(Config, A), - rabbit_ha_test_producer:await_response(ProducerPid), - - {#'basic.get_ok'{}, #amqp_msg{payload = Payload}} = - amqp_channel:call(Node2Channel, #'basic.get'{queue = Queue}), - %% There is only one message. - #'basic.get_empty'{} = amqp_channel:call(Node2Channel, #'basic.get'{queue = Queue}), - ok. - - - stop(Config, Node) -> rabbit_ct_broker_helpers:stop_node_after(Config, Node, 50). diff --git a/test/unit_gm_SUITE.erl b/test/unit_gm_SUITE.erl index e8cdfde482..6724a767d2 100644 --- a/test/unit_gm_SUITE.erl +++ b/test/unit_gm_SUITE.erl @@ -37,7 +37,6 @@ all() -> join_leave, broadcast, confirmed_broadcast, - member_death, receive_in_order, unexpected_msg, down_in_members_change @@ -74,31 +73,6 @@ broadcast(_Config) -> confirmed_broadcast(_Config) -> passed = do_broadcast(fun gm:confirmed_broadcast/2). -member_death(_Config) -> - passed = with_two_members( - fun (Pid, Pid2) -> - {ok, Pid3} = gm:start_link( - ?MODULE, ?MODULE, self(), - fun rabbit_misc:execute_mnesia_transaction/1), - passed = receive_joined(Pid3, [Pid, Pid2, Pid3], - timeout_joining_gm_group_3), - passed = receive_birth(Pid, Pid3, timeout_waiting_for_birth_3_1), - passed = receive_birth(Pid2, Pid3, timeout_waiting_for_birth_3_2), - - unlink(Pid3), - exit(Pid3, kill), - - %% Have to do some broadcasts to ensure that all members - %% find out about the death. - passed = (broadcast_fun(fun gm:confirmed_broadcast/2))( - Pid, Pid2), - - passed = receive_death(Pid, Pid3, timeout_waiting_for_death_3_1), - passed = receive_death(Pid2, Pid3, timeout_waiting_for_death_3_2), - - passed - end). - receive_in_order(_Config) -> passed = with_two_members( fun (Pid, Pid2) -> |
