diff options
| author | Michael Klishin <mklishin@pivotal.io> | 2019-11-26 04:51:15 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-26 04:51:15 +0300 |
| commit | 802da086dd457b46cffcdade142d2b3ba4387f53 (patch) | |
| tree | ce6306ff4a73435f40ccfe9dd7e45bd0bb9aafea /test | |
| parent | d130694df550305b128aeb2dfcd050f8f0522a37 (diff) | |
| parent | cb4989f31d56a072d7b12cf11f08431701e5a4e2 (diff) | |
| download | rabbitmq-server-git-802da086dd457b46cffcdade142d2b3ba4387f53.tar.gz | |
Merge pull request #2167 from rabbitmq/basic-get-sac-qq
Reject basic.get operations on quorum queues with single active consumer enabled
Diffstat (limited to 'test')
| -rw-r--r-- | test/rabbit_fifo_SUITE.erl | 15 | ||||
| -rw-r--r-- | test/single_active_consumer_SUITE.erl | 14 |
2 files changed, 28 insertions, 1 deletions
diff --git a/test/rabbit_fifo_SUITE.erl b/test/rabbit_fifo_SUITE.erl index 1714d57932..2de6a86e84 100644 --- a/test/rabbit_fifo_SUITE.erl +++ b/test/rabbit_fifo_SUITE.erl @@ -640,6 +640,21 @@ down_noconnection_returns_checked_out_test(_) -> ?assertEqual(lists:sort(Returns), Returns), ok. +single_active_consumer_basic_get_test(_) -> + Cid = {?FUNCTION_NAME, self()}, + State0 = init(#{name => ?FUNCTION_NAME, + queue_resource => rabbit_misc:r("/", queue, + atom_to_binary(?FUNCTION_NAME, utf8)), + release_cursor_interval => 0, + single_active_consumer_on => true}), + ?assertEqual(single_active, State0#rabbit_fifo.cfg#cfg.consumer_strategy), + ?assertEqual(0, map_size(State0#rabbit_fifo.consumers)), + {State1, _} = enq(1, 1, first, State0), + {_State, {error, unsupported}} = + apply(meta(2), rabbit_fifo:make_checkout(Cid, {dequeue, unsettled}, #{}), + State1), + ok. + single_active_consumer_test(_) -> State0 = init(#{name => ?FUNCTION_NAME, queue_resource => rabbit_misc:r("/", queue, diff --git a/test/single_active_consumer_SUITE.erl b/test/single_active_consumer_SUITE.erl index 09d0886bf6..128d880eb6 100644 --- a/test/single_active_consumer_SUITE.erl +++ b/test/single_active_consumer_SUITE.erl @@ -40,7 +40,8 @@ groups() -> all_messages_go_to_one_consumer, fallback_to_another_consumer_when_first_one_is_cancelled, fallback_to_another_consumer_when_exclusive_consumer_channel_is_cancelled, - fallback_to_another_consumer_when_first_one_is_cancelled_manual_acks + fallback_to_another_consumer_when_first_one_is_cancelled_manual_acks, + basic_get_is_unsupported %% amqp_exclusive_consume_fails_on_exclusive_consumer_queue % Exclusive consume not implemented in QQ ]} ]. @@ -267,6 +268,17 @@ fallback_to_another_consumer_when_exclusive_consumer_channel_is_cancelled(Config [amqp_connection:close(Conn) || Conn <- [C1, C2, C3, C]], ok. +basic_get_is_unsupported(Config) -> + {C, Ch} = connection_and_channel(Config), + Q = queue_declare(Ch, Config), + + ?assertExit( + {{shutdown, {server_initiated_close, 405, _}}, _}, + amqp_channel:call(Ch, #'basic.get'{queue = Q, no_ack = false})), + + amqp_connection:close(C), + ok. + amqp_exclusive_consume_fails_on_exclusive_consumer_queue(Config) -> {C, Ch} = connection_and_channel(Config), Q = queue_declare(Ch, Config), |
