Merge pull request #10826 from thalesmg/test-partial-batch-expired-inflight-v50

test(buffer_worker): add assertion for inflight count after batch expiration
This commit is contained in:
Thales Macedo Garitezi 2023-05-30 09:05:59 -03:00 committed by GitHub
commit 75fcac9711
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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 %% some queries are not expired, put them back to the inflight batch
%% so it can be either acked now or retried later %% so it can be either acked now or retried later
ok = update_inflight_item(InflightTID, Ref, RealNotExpired, NumExpired), 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) do_handle_async_batch_reply(ReplyContext#{min_batch := RealNotExpired}, Result)
end. end.

View File

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