fix(test): ci failed due to existing subscriptions
This commit is contained in:
parent
444c721f93
commit
8b0a6d955b
|
@ -41,6 +41,21 @@ end_per_suite(_Config) ->
|
||||||
%% PubSub Test
|
%% PubSub Test
|
||||||
%%--------------------------------------------------------------------
|
%%--------------------------------------------------------------------
|
||||||
|
|
||||||
|
t_stats_fun(_) ->
|
||||||
|
?assertEqual(0, emqx_stats:getstat('subscribers.count')),
|
||||||
|
?assertEqual(0, emqx_stats:getstat('subscriptions.count')),
|
||||||
|
?assertEqual(0, emqx_stats:getstat('suboptions.count')),
|
||||||
|
ok = emqx_broker:subscribe(<<"topic">>, <<"clientid">>),
|
||||||
|
ok = emqx_broker:subscribe(<<"topic2">>, <<"clientid">>),
|
||||||
|
emqx_broker:stats_fun(),
|
||||||
|
ct:sleep(10),
|
||||||
|
?assertEqual(2, emqx_stats:getstat('subscribers.count')),
|
||||||
|
?assertEqual(2, emqx_stats:getstat('subscribers.max')),
|
||||||
|
?assertEqual(2, emqx_stats:getstat('subscriptions.count')),
|
||||||
|
?assertEqual(2, emqx_stats:getstat('subscriptions.max')),
|
||||||
|
?assertEqual(2, emqx_stats:getstat('suboptions.count')),
|
||||||
|
?assertEqual(2, emqx_stats:getstat('suboptions.max')).
|
||||||
|
|
||||||
t_subscribed(_) ->
|
t_subscribed(_) ->
|
||||||
emqx_broker:subscribe(<<"topic">>),
|
emqx_broker:subscribe(<<"topic">>),
|
||||||
?assertEqual(false, emqx_broker:subscribed(undefined, <<"topic">>)),
|
?assertEqual(false, emqx_broker:subscribed(undefined, <<"topic">>)),
|
||||||
|
@ -191,21 +206,6 @@ t_shard(_) ->
|
||||||
end),
|
end),
|
||||||
ok = meck:unload(emqx_broker_helper).
|
ok = meck:unload(emqx_broker_helper).
|
||||||
|
|
||||||
t_stats_fun(_) ->
|
|
||||||
?assertEqual(0, emqx_stats:getstat('subscribers.count')),
|
|
||||||
?assertEqual(0, emqx_stats:getstat('subscriptions.count')),
|
|
||||||
?assertEqual(0, emqx_stats:getstat('suboptions.count')),
|
|
||||||
ok = emqx_broker:subscribe(<<"topic">>, <<"clientid">>),
|
|
||||||
ok = emqx_broker:subscribe(<<"topic2">>, <<"clientid">>),
|
|
||||||
emqx_broker:stats_fun(),
|
|
||||||
ct:sleep(10),
|
|
||||||
?assertEqual(2, emqx_stats:getstat('subscribers.count')),
|
|
||||||
?assertEqual(2, emqx_stats:getstat('subscribers.max')),
|
|
||||||
?assertEqual(2, emqx_stats:getstat('subscriptions.count')),
|
|
||||||
?assertEqual(2, emqx_stats:getstat('subscriptions.max')),
|
|
||||||
?assertEqual(2, emqx_stats:getstat('suboptions.count')),
|
|
||||||
?assertEqual(2, emqx_stats:getstat('suboptions.max')).
|
|
||||||
|
|
||||||
recv_msgs(Count) ->
|
recv_msgs(Count) ->
|
||||||
recv_msgs(Count, []).
|
recv_msgs(Count, []).
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue