Skip to content

Commit

Permalink
chore(tests): fix conunt error
Browse files Browse the repository at this point in the history
  • Loading branch information
Rory-Z committed Aug 6, 2021
1 parent 992e094 commit 43de1c2
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions test/emqx_broker_SUITE.erl
Original file line number Diff line number Diff line change
Expand Up @@ -192,19 +192,19 @@ t_shard(_) ->
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')),
N = emqx_stats:getstat('subscribers.count'),
N = emqx_stats:getstat('subscriptions.count'),
N = 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')).
?assertEqual(N + 2, emqx_stats:getstat('subscribers.count')),
?assertEqual(N + 2, emqx_stats:getstat('subscribers.max')),
?assertEqual(N + 2, emqx_stats:getstat('subscriptions.count')),
?assertEqual(N + 2, emqx_stats:getstat('subscriptions.max')),
?assertEqual(N + 2, emqx_stats:getstat('suboptions.count')),
?assertEqual(N + 2, emqx_stats:getstat('suboptions.max')).

recv_msgs(Count) ->
recv_msgs(Count, []).
Expand Down

0 comments on commit 43de1c2

Please sign in to comment.