Merge pull request #10440 from HJianBo/fix-cassa-flaky-test

chore: fix flaky test in emqx_ee_bridge_cassa_SUITE
This commit is contained in:
JianBo He 2023-04-18 22:44:54 +08:00 committed by GitHub
commit ad4b7d59eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 6 deletions

View File

@ -530,15 +530,16 @@ t_write_failure(Config) ->
fun(Trace0) -> fun(Trace0) ->
ct:pal("trace: ~p", [Trace0]), ct:pal("trace: ~p", [Trace0]),
Trace = ?of_kind(buffer_worker_flush_nack, Trace0), Trace = ?of_kind(buffer_worker_flush_nack, Trace0),
?assertMatch([#{result := {async_return, {error, _}}} | _], Trace), [#{result := Result} | _] = Trace,
[#{result := {async_return, {error, Error}}} | _] = Trace, case Result of
case Error of {async_return, {error, {resource_error, _}}} ->
{resource_error, _} ->
ok; ok;
{recoverable_error, disconnected} -> {async_return, {error, {recoverable_error, disconnected}}} ->
ok;
{error, {resource_error, _}} ->
ok; ok;
_ -> _ ->
ct:fail("unexpected error: ~p", [Error]) ct:fail("unexpected error: ~p", [Result])
end end
end end
), ),