From de810e04fd1bd0d13681a7a4da06f183a35986dd Mon Sep 17 00:00:00 2001 From: William Yang Date: Wed, 11 Jan 2023 16:53:03 +0100 Subject: [PATCH] chore(quic): clean test code --- apps/emqx/src/emqx_quic_connection.erl | 2 +- apps/emqx/src/emqx_quic_stream.erl | 8 +++++--- apps/emqx/test/emqx_mqtt_protocol_v5_SUITE.erl | 1 - apps/emqx/test/emqx_quic_multistreams_SUITE.erl | 10 ---------- 4 files changed, 6 insertions(+), 15 deletions(-) diff --git a/apps/emqx/src/emqx_quic_connection.erl b/apps/emqx/src/emqx_quic_connection.erl index 7538307e8..ae195cd6b 100644 --- a/apps/emqx/src/emqx_quic_connection.erl +++ b/apps/emqx/src/emqx_quic_connection.erl @@ -23,7 +23,7 @@ -include_lib("quicer/include/quicer.hrl"). -include_lib("emqx/include/emqx_quic.hrl"). --behavior(quicer_connection). +-behaviour(quicer_connection). -export([ init/1, diff --git a/apps/emqx/src/emqx_quic_stream.erl b/apps/emqx/src/emqx_quic_stream.erl index d1b205cf0..5f7f93866 100644 --- a/apps/emqx/src/emqx_quic_stream.erl +++ b/apps/emqx/src/emqx_quic_stream.erl @@ -14,7 +14,10 @@ %% limitations under the License. %%-------------------------------------------------------------------- -%% MQTT/QUIC control Stream +%% MQTT over QUIC +%% multistreams: This is the control stream. +%% single stream: This is the only main stream. +%% callbacks are from emqx_connection process rather than quicer_stream -module(emqx_quic_stream). -ifndef(BUILD_WITHOUT_QUIC). @@ -66,10 +69,9 @@ _ => _ }. -%% for accepting +%%% For Accepting New Remote Stream -spec wait({pid(), connection_handle(), socket_info()}) -> {ok, socket()} | {error, enotconn}. -%%% For Accepting New Remote Stream wait({ConnOwner, Conn, ConnInfo}) -> {ok, Conn} = quicer:async_accept_stream(Conn, []), ConnOwner ! {self(), stream_acceptor_ready}, diff --git a/apps/emqx/test/emqx_mqtt_protocol_v5_SUITE.erl b/apps/emqx/test/emqx_mqtt_protocol_v5_SUITE.erl index 0199bbc10..d3de74f72 100644 --- a/apps/emqx/test/emqx_mqtt_protocol_v5_SUITE.erl +++ b/apps/emqx/test/emqx_mqtt_protocol_v5_SUITE.erl @@ -65,7 +65,6 @@ init_per_group(quic, Config) -> UdpPort = 1884, emqx_common_test_helpers:start_apps([]), emqx_common_test_helpers:ensure_quic_listener(?MODULE, UdpPort), - emqx_logger:set_log_level(debug), [{port, UdpPort}, {conn_fun, quic_connect} | Config]; init_per_group(_, Config) -> emqx_common_test_helpers:stop_apps([]), diff --git a/apps/emqx/test/emqx_quic_multistreams_SUITE.erl b/apps/emqx/test/emqx_quic_multistreams_SUITE.erl index 17f4cbbc2..593613fcc 100644 --- a/apps/emqx/test/emqx_quic_multistreams_SUITE.erl +++ b/apps/emqx/test/emqx_quic_multistreams_SUITE.erl @@ -141,16 +141,6 @@ init_per_suite(Config) -> emqx_common_test_helpers:start_apps([]), UdpPort = 14567, start_emqx_quic(UdpPort), - %% dbg:tracer(process, {fun dbg:dhandler/2, group_leader()}), - %% dbg:p(all, c), - %% dbg:tpl(quicer_stream, handle_info, c), - %% dbg:tp(emqx_quic_connection, cx), - %% dbg:tp(emqx_quic_stream, cx), - %% dbg:tp(emqtt, cx), - %% dbg:tpl(emqtt_quic_stream, cx), - %% dbg:tpl(emqx_quic_stream, cx), - %% dbg:tpl(emqx_quic_data_stream, cx), - %% dbg:tpl(emqtt, cx), [{port, UdpPort}, {pub_qos, 0}, {sub_qos, 0} | Config]. end_per_suite(_) ->