Skip to content

Commit

Permalink
test: fix several unused variable warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
thalesmg committed Dec 18, 2024
1 parent 3df1b8e commit 9f6abc8
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 26 deletions.
6 changes: 2 additions & 4 deletions apps/emqx/test/emqx_persistent_session_ds_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,6 @@ t_session_unsubscription_idempotency(Config) ->
%% This testcase verifies that the session handles update of the
%% subscription settings by the client correctly.
t_subscription_state_change(Config) ->
[Node1Spec | _] = ?config(node_specs, Config),
[Node1] = ?config(nodes, Config),
Port = get_mqtt_port(Node1, tcp),
TopicFilter = <<"t/+">>,
Expand Down Expand Up @@ -484,7 +483,7 @@ t_subscription_state_change(Config) ->
ok = emqtt:puback(Sub, PI1),
{ok, _} = emqtt:publish(Pub, <<"t/1">>, <<"2">>, ?QOS_2),
%% Verify that QoS of subscription has been updated:
[#{packet_id := PI2, qos := ?QOS_2, topic := <<"t/1">>, payload := <<"2">>}] =
[#{packet_id := _PI2, qos := ?QOS_2, topic := <<"t/1">>, payload := <<"2">>}] =
emqx_common_test_helpers:wait_publishes(1, 5_000),
WaitGC(),
#{subscriptions := Subs3, subscription_states := SStates3, streams := Streams3} = GetS(),
Expand All @@ -507,7 +506,6 @@ t_subscription_state_change(Config) ->
%% This testcase verifies the lifetimes of session's subscriptions to
%% new stream events.
t_new_stream_notifications(Config) ->
[Node1Spec | _] = ?config(node_specs, Config),
[Node1] = ?config(nodes, Config),
Port = get_mqtt_port(Node1, tcp),
ClientId = mk_clientid(?FUNCTION_NAME, sub),
Expand Down Expand Up @@ -1065,7 +1063,7 @@ check_stream_state_transitions(Trace) ->
).

%% erlfmt-ignore
check_stream_state_transitions(StreamId, [], _) ->
check_stream_state_transitions(_StreamId, [], _) ->
true;
check_stream_state_transitions(StreamId = {ClientId, Key}, ['$restore', To | Rest], State) ->
%% This clause verifies that restored session re-calculates states
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1498,9 +1498,6 @@ t_failed_creation_then_fixed(Config) ->
%% consume the messages produced during the down time.
t_receive_after_recovery(Config) ->
ct:timetrap(120_000),
ProxyPort = ?config(proxy_port, Config),
ProxyHost = ?config(proxy_host, Config),
ProxyName = ?config(proxy_name, Config),
MQTTTopic = ?config(mqtt_topic, Config),
NPartitions = ?config(num_partitions, Config),
KafkaName = ?config(kafka_name, Config),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,6 @@ t_sync_query(Config) ->
%% implementation returns a tuple with new state.
%% See also: https://emqx.atlassian.net/browse/EMQX-13496.
t_timeout_during_connector_health_check(Config0) ->
ProxyName = ?config(proxy_name, Config0),
ProxyHost = ?config(proxy_host, Config0),
ProxyPort = ?config(proxy_port, Config0),
ConnectorName = ?config(connector_name, Config0),
Overrides = #{<<"resource_opts">> => #{<<"health_check_interval">> => <<"700ms">>}},
Config = emqx_bridge_v2_testlib:proplist_update(
Config0,
Expand All @@ -308,10 +304,6 @@ t_timeout_during_connector_health_check(Config0) ->
begin
{201, _} = create_bridge_api(Config, Overrides),

%% emqx_common_test_helpers:with_failure(timeout, ProxyName, ProxyHost, ProxyPort, fun() ->
%% ?retry(500, 10, ?assertEqual(<<"disconnected">>, GetConnectorStatus())),
%% ok
%% end),
%% Wait until it's disconnected
emqx_common_test_helpers:with_mock(
emqx_resource_pool,
Expand Down
1 change: 0 additions & 1 deletion apps/emqx_bridge_mysql/test/emqx_bridge_v2_mysql_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,6 @@ t_timeout_disconnected_then_recover(Config) ->
ProxyName = ?config(proxy_name, Config),
ProxyHost = ?config(proxy_host, Config),
ProxyPort = ?config(proxy_port, Config),
ConnectorName = ?config(connector_name, Config),
?check_trace(
emqx_bridge_v2_testlib:snk_timetrap(),
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ parse_and_check(InnerConfigs) ->
),
Checked.

link(Name) ->
link(Name, _Overrides = #{}).

link(Name, Overrides) ->
Default = #{
<<"name">> => Name,
Expand Down
8 changes: 4 additions & 4 deletions apps/emqx_ds_backends/test/emqx_ds_backends_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ t_02_smoke_iterate(Config) ->
timer:sleep(1000),
[{_, Stream}] = emqx_ds:get_streams(DB, TopicFilter, StartTime),
{ok, Iter0} = emqx_ds:make_iterator(DB, Stream, TopicFilter, StartTime),
{ok, Iter, Batch} = emqx_ds_test_helpers:consume_iter(DB, Iter0),
{ok, _Iter, Batch} = emqx_ds_test_helpers:consume_iter(DB, Iter0),
emqx_ds_test_helpers:diff_messages(Msgs, Batch).

%% A simple smoke test that verifies that poll request is fulfilled
Expand Down Expand Up @@ -181,7 +181,7 @@ t_05_restart(Config) ->
{ok, _} = application:ensure_all_started(emqx_durable_storage),
ok = emqx_ds_open_db(DB, opts(Config)),
%% The old iterator should be still operational:
{ok, Iter, Batch} = emqx_ds_test_helpers:consume_iter(DB, Iter0),
{ok, _Iter, Batch} = emqx_ds_test_helpers:consume_iter(DB, Iter0),
emqx_ds_test_helpers:diff_messages(Msgs, Batch).

t_06_smoke_add_generation(Config) ->
Expand Down Expand Up @@ -540,7 +540,7 @@ t_drop_generation_with_never_used_iterator(Config) ->
?assertNotEqual(Stream0, Stream1),
{ok, Iter1} = emqx_ds:make_iterator(DB, Stream1, TopicFilter, StartTime),

{ok, Iter, Batch} = emqx_ds_test_helpers:consume_iter(DB, Iter1, #{batch_size => 1}),
{ok, _Iter, Batch} = emqx_ds_test_helpers:consume_iter(DB, Iter1, #{batch_size => 1}),
emqx_ds_test_helpers:diff_messages(Msgs1, Batch).

t_drop_generation_with_used_once_iterator(Config) ->
Expand Down Expand Up @@ -718,7 +718,7 @@ groups() ->
TCs = emqx_common_test_helpers:all(?MODULE),
[{Backend, TCs -- exclude(Backend)} || Backend <- backends()].

init_per_group(emqx_fdb_ds, Config) ->
init_per_group(emqx_fdb_ds, _Config) ->
{skip, fixme};
init_per_group(emqx_ds_builtin_raft, Config) ->
%% Raft backend is an odd one, as its main module is named
Expand Down
1 change: 0 additions & 1 deletion apps/emqx_durable_storage/src/emqx_ds_beamformer.erl
Original file line number Diff line number Diff line change
Expand Up @@ -857,7 +857,6 @@ pack_test_() ->
].

split_test_() ->
Always = fun(_It, _Msg) -> true end,
M1 = {<<"1">>, #message{id = <<"1">>}},
M2 = {<<"2">>, #message{id = <<"2">>}},
M3 = {<<"3">>, #message{id = <<"3">>}},
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_durable_storage/src/emqx_durable_storage.app.src
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{application, emqx_durable_storage, [
{description, "Message persistence and subscription replays for EMQX"},
% strict semver, bump manually!
{vsn, "0.4.2"},
{vsn, "0.4.3"},
{modules, []},
{registered, []},
{applications, [kernel, stdlib, rocksdb, gproc, mria, emqx_utils, gen_rpc]},
Expand Down
2 changes: 1 addition & 1 deletion apps/emqx_resource/test/emqx_connector_demo.erl
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ batch_individual_reply({async, ReplyFunAndArgs}, InstId, Batch, State) ->
on_get_status(_InstId, #{health_check_error := true}) ->
?tp(connector_demo_health_check_error, #{}),
?status_disconnected;
on_get_status(_InstId, State = #{health_check_error := {msg, Message}}) ->
on_get_status(_InstId, _State = #{health_check_error := {msg, Message}}) ->
?tp(connector_demo_health_check_error, #{}),
{?status_disconnected, Message};
on_get_status(_InstId, #{pid := Pid, health_check_error := {delay, Delay}}) ->
Expand Down

0 comments on commit 9f6abc8

Please sign in to comment.