test(buffer_worker): add assertion for inflight count after batch expiration

Fixes https://emqx.atlassian.net/browse/EMQX-9829
This commit is contained in:
Thales Macedo Garitezi 2023-05-25 16:11:37 -03:00
parent 8d6652f162
commit db60dcbada
2 changed files with 16 additions and 0 deletions

View File

@ -1256,6 +1256,13 @@ handle_async_batch_reply2([Inflight], ReplyContext, Result, Now) ->
%% some queries are not expired, put them back to the inflight batch
%% so it can be either acked now or retried later
ok = update_inflight_item(InflightTID, Ref, RealNotExpired, NumExpired),
?tp_ignore_side_effects_in_prod(
handle_async_reply_partially_expired,
#{
inflight_count => inflight_count(InflightTID),
num_inflight_messages => inflight_num_msgs(InflightTID)
}
),
do_handle_async_batch_reply(ReplyContext#{min_batch := RealNotExpired}, Result)
end.

View File

@ -2248,6 +2248,15 @@ do_t_expiration_async_after_reply(IsBatch) ->
}
],
?of_kind(handle_async_reply_expired, Trace)
),
?assertMatch(
[
#{
inflight_count := 1,
num_inflight_messages := 1
}
],
?of_kind(handle_async_reply_partially_expired, Trace)
);
single ->
?assertMatch(