From 5fd7f65a1f09637f4f3c7080f1e9da34d71aebd7 Mon Sep 17 00:00:00 2001 From: Andrew Mayorov Date: Wed, 1 Feb 2023 16:52:47 +0300 Subject: [PATCH] test(bufworker): make testcase simpler to follow The confusion was due to the fact that subsequent query was missing `async_reply_fun` and thus, was not accumulating in the results. --- apps/emqx_resource/test/emqx_resource_SUITE.erl | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/apps/emqx_resource/test/emqx_resource_SUITE.erl b/apps/emqx_resource/test/emqx_resource_SUITE.erl index 620516a88..3ae69a47d 100644 --- a/apps/emqx_resource/test/emqx_resource_SUITE.erl +++ b/apps/emqx_resource/test/emqx_resource_SUITE.erl @@ -625,7 +625,7 @@ t_query_counter_async_inflight_batch(_) -> %% this will block the resource_worker as the inflight window is full now {ok, {ok, _}} = ?wait_async_action( - emqx_resource:query(?ID, {inc_counter, 2}), + emqx_resource:query(?ID, {inc_counter, 2}, ReqOpts()), #{?snk_kind := buffer_worker_flush_but_inflight_full}, 5_000 ), @@ -635,11 +635,7 @@ t_query_counter_async_inflight_batch(_) -> [] ), - %% NOTE - %% The query above won't affect the size of the results table for some reason, - %% it's not clear if this is expected behaviour. Only the `async_reply_fun` - %% defined below will be called for the whole batch consisting of 2 increments. - Sent2 = Sent1 + 0, + Sent2 = Sent1 + 1, tap_metrics(?LINE), %% send query now will fail because the resource is blocked.