Skip to content

Commit 1aa97a7

Browse files
Merge pull request #13474 from rabbitmq/mergify/bp/v4.1.x/pr-13409
amqp_client_SUITE: Fix frequent test failures (backport #13409)
2 parents 6faaf13 + 60db5ab commit 1aa97a7

File tree

4 files changed

+149
-117
lines changed

4 files changed

+149
-117
lines changed

.github/workflows/test-make-tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- parallel-ct-set-2
2626
- parallel-ct-set-3
2727
- parallel-ct-set-4
28+
- ct-amqp_client
2829
- ct-clustering_management
2930
- eunit ct-dead_lettering
3031
- ct-feature_flags

deps/amqp10_client/src/amqp10_client_connection.erl

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,20 @@ open_sent({call, From}, begin_session,
287287
#state{pending_session_reqs = PendingSessionReqs} = State) ->
288288
State1 = State#state{pending_session_reqs = [From | PendingSessionReqs]},
289289
{keep_state, State1};
290+
open_sent(_EvtType, {close, Reason}, State) ->
291+
case send_close(State, Reason) of
292+
ok ->
293+
%% "After writing this frame the peer SHOULD continue to read from the connection
294+
%% until it receives the partner's close frame (in order to guard against
295+
%% erroneously or maliciously implemented partners, a peer SHOULD implement a
296+
%% timeout to give its partner a reasonable time to receive and process the close
297+
%% before giving up and simply closing the underlying transport mechanism)." [§2.4.3]
298+
{next_state, close_sent, State, {state_timeout, ?TIMEOUT, received_no_close_frame}};
299+
{error, closed} ->
300+
{stop, normal, State};
301+
Error ->
302+
{stop, Error, State}
303+
end;
290304
open_sent(info, {'DOWN', MRef, process, _, _},
291305
#state{reader_m_ref = MRef}) ->
292306
{stop, {shutdown, reader_down}}.
@@ -345,7 +359,10 @@ close_sent(_EvtType, #'v1_0.close'{} = Close, #state{config = Config}) ->
345359
ok = notify_closed(Config, Close),
346360
{stop, normal};
347361
close_sent(state_timeout, received_no_close_frame, _Data) ->
348-
{stop, normal}.
362+
{stop, normal};
363+
close_sent(_EvtType, #'v1_0.open'{}, _Data) ->
364+
%% Transition from CLOSE_PIPE to CLOSE_SENT in figure 2.23.
365+
keep_state_and_data.
349366

350367
set_other_procs0(OtherProcs, State) ->
351368
#{sessions_sup := SessionsSup,

deps/rabbit/Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ bats: $(BATS)
175175

176176
tests:: bats
177177

178-
SLOW_CT_SUITES := backing_queue \
178+
SLOW_CT_SUITES := amqp_client \
179+
backing_queue \
179180
channel_interceptor \
180181
cluster \
181182
cluster_rename \
@@ -257,7 +258,7 @@ define ct_master.erl
257258
halt(0)
258259
endef
259260

260-
PARALLEL_CT_SET_1_A = amqp_client unit_cluster_formation_locking_mocks unit_cluster_formation_sort_nodes unit_collections unit_config_value_encryption unit_connection_tracking
261+
PARALLEL_CT_SET_1_A = unit_cluster_formation_locking_mocks unit_cluster_formation_sort_nodes unit_collections unit_config_value_encryption unit_connection_tracking
261262
PARALLEL_CT_SET_1_B = amqp_address amqp_auth amqp_credit_api_v2 amqp_filtex amqp_dotnet amqp_jms signal_handling single_active_consumer unit_access_control_authn_authz_context_propagation unit_access_control_credential_validation unit_amqp091_content_framing unit_amqp091_server_properties unit_app_management
262263
PARALLEL_CT_SET_1_C = amqp_proxy_protocol amqpl_consumer_ack amqpl_direct_reply_to backing_queue bindings rabbit_db_maintenance rabbit_db_msup rabbit_db_policy rabbit_db_queue rabbit_db_topic_exchange rabbit_direct_reply_to_prop cluster_limit cluster_minority term_to_binary_compat_prop topic_permission transactions unicode unit_access_control
263264
PARALLEL_CT_SET_1_D = amqqueue_backward_compatibility channel_interceptor channel_operation_timeout classic_queue classic_queue_prop config_schema peer_discovery_dns peer_discovery_tmp_hidden_node per_node_limit per_user_connection_channel_limit
@@ -282,7 +283,7 @@ PARALLEL_CT_SET_2 = $(sort $(PARALLEL_CT_SET_2_A) $(PARALLEL_CT_SET_2_B) $(PARAL
282283
PARALLEL_CT_SET_3 = $(sort $(PARALLEL_CT_SET_3_A) $(PARALLEL_CT_SET_3_B) $(PARALLEL_CT_SET_3_C) $(PARALLEL_CT_SET_3_D))
283284
PARALLEL_CT_SET_4 = $(sort $(PARALLEL_CT_SET_4_A) $(PARALLEL_CT_SET_4_B) $(PARALLEL_CT_SET_4_C) $(PARALLEL_CT_SET_4_D))
284285

285-
SEQUENTIAL_CT_SUITES = clustering_management dead_lettering feature_flags metadata_store_clustering quorum_queue rabbit_stream_queue
286+
SEQUENTIAL_CT_SUITES = amqp_client clustering_management dead_lettering feature_flags metadata_store_clustering quorum_queue rabbit_stream_queue
286287
PARALLEL_CT_SUITES = $(PARALLEL_CT_SET_1) $(PARALLEL_CT_SET_2) $(PARALLEL_CT_SET_3) $(PARALLEL_CT_SET_4)
287288

288289
ifeq ($(filter-out $(SEQUENTIAL_CT_SUITES) $(PARALLEL_CT_SUITES),$(CT_SUITES)),)

0 commit comments

Comments
 (0)