diff options
| author | Philip Kuryloski <pkuryloski@pivotal.io> | 2020-04-20 15:23:42 +0200 |
|---|---|---|
| committer | Jean-Sébastien Pédron <jean-sebastien@rabbitmq.com> | 2020-04-21 15:18:42 +0200 |
| commit | de224081cb8fe3a260ab42ef27530c109e6a5085 (patch) | |
| tree | 90f5392782ee67252a519e386dc34b65460ab069 /src | |
| parent | c139e2f3ea7dd8aa8c90f5917c1e0526c2790fa8 (diff) | |
| download | rabbitmq-server-git-de224081cb8fe3a260ab42ef27530c109e6a5085.tar.gz | |
Attempt to make unit_log_managment_SUITE less flaky
Rather than wait a fixed 2000ms, poll the test condition for up to
5000ms.
Also switch from a raw message send in rabbit.erl to a gen_event:call/4
to the lager backend. I had hoped this would behave synchronously, which
it does not appear to, but at least we now get a value back from the
call.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit.erl | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/rabbit.erl b/src/rabbit.erl index b806eb8a17..e109c10c46 100644 --- a/src/rabbit.erl +++ b/src/rabbit.erl @@ -798,10 +798,13 @@ rotate_logs() -> %% lager_file_backend. We should use a proper API, when %% it's added to Lager. %% - %% FIXME: This message is asynchronous, therefore this - %% entire call is asynchronous: at the end of this - %% function, we can't guaranty the rotation is completed. - [SinkName ! {rotate, FileName} || FileName <- FileNames], + %% FIXME: This call is effectively asynchronous: at the + %% end of this function, we can't guaranty the rotation + %% is completed. + [ok = gen_event:call(SinkName, + {lager_file_backend, FileName}, + rotate, + infinity) || FileName <- FileNames], lager:log(SinkName, info, self(), "Log file re-opened after forced rotation", []), Acc |
