test: drop custom `loop_wait` in favor of snabkaffe's `?retry`
This commit is contained in:
parent
2b4e49e7df
commit
c883e4b36a
|
@ -1539,7 +1539,10 @@ t_async_reply_multi_eval(_Config) ->
|
|||
end,
|
||||
#{}
|
||||
),
|
||||
F = fun() ->
|
||||
?retry(
|
||||
ResumeInterval,
|
||||
TotalTime div ResumeInterval,
|
||||
begin
|
||||
Metrics = tap_metrics(?LINE),
|
||||
#{
|
||||
counters := Counters,
|
||||
|
@ -1554,8 +1557,8 @@ t_async_reply_multi_eval(_Config) ->
|
|||
} = Counters,
|
||||
?assertEqual(TotalQueries, Matched - 1),
|
||||
?assertEqual(Matched, Success + Dropped + LateReply + Failed)
|
||||
end,
|
||||
loop_wait(F, _Interval = 5, TotalTime).
|
||||
end
|
||||
).
|
||||
|
||||
t_retry_async_inflight_batch(_Config) ->
|
||||
ResumeInterval = 1_000,
|
||||
|
@ -2622,15 +2625,3 @@ assert_async_retry_fail_then_succeed_inflight(Trace) ->
|
|||
)
|
||||
),
|
||||
ok.
|
||||
|
||||
loop_wait(F, Interval, TotalTime) when Interval >= TotalTime ->
|
||||
%% do it for the last time
|
||||
F();
|
||||
loop_wait(F, Interval, TotalTime) ->
|
||||
try
|
||||
F()
|
||||
catch
|
||||
_:_ ->
|
||||
timer:sleep(Interval),
|
||||
loop_wait(F, Interval, TotalTime - Interval)
|
||||
end.
|
||||
|
|
Loading…
Reference in New Issue