diff options
author | Michael Klishin <michael@clojurewerkz.org> | 2019-08-11 13:20:19 +1000 |
---|---|---|
committer | Michael Klishin <michael@clojurewerkz.org> | 2019-08-11 13:20:19 +1000 |
commit | 5b1086156e30cf17f36908bd0813d1382a13c856 (patch) | |
tree | 70d04a58e15ae55a09bacf9f083cc8e05b9a5ea5 /deps/rabbitmq_cli/test/diagnostics | |
parent | f4be415e3bc92781e737986135f38079cfb04c04 (diff) | |
download | rabbitmq-server-git-5b1086156e30cf17f36908bd0813d1382a13c856.tar.gz |
diagnostics log_tail_stream: remove a fragile test
It makes a lot of assumptions about Lager's log flush
timing and can be tripped by the peak rate protection
mechanism. This test module has a high rate of false
positives on Concourse.
There is another test that asserts over a "folded" stream, so
code coverage is kept about the same.
Diffstat (limited to 'deps/rabbitmq_cli/test/diagnostics')
-rw-r--r-- | deps/rabbitmq_cli/test/diagnostics/log_tail_stream_command_test.exs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/deps/rabbitmq_cli/test/diagnostics/log_tail_stream_command_test.exs b/deps/rabbitmq_cli/test/diagnostics/log_tail_stream_command_test.exs index cd21a6a5f0..08b9068102 100644 --- a/deps/rabbitmq_cli/test/diagnostics/log_tail_stream_command_test.exs +++ b/deps/rabbitmq_cli/test/diagnostics/log_tail_stream_command_test.exs @@ -58,35 +58,6 @@ defmodule LogTailStreamCommandTest do assert match?({:badrpc, _}, @command.run([], Map.merge(context[:opts], %{node: :jake@thedog, timeout: 100}))) end - test "run: streams messages from the log", context do - ensure_log_file() - - stream = @command.run([], context[:opts]) - :rpc.call(get_rabbit_hostname(), :rabbit_log, :error, ["Message"]) - pid = self() - ref = make_ref() - Stream.transform(stream, - "", - fn(line, acc) -> - acc1 = acc <> line - case String.ends_with?(line, "\n") do - true -> - ## A hacky way to get the last value of the stream transform - send pid, {:data, ref, acc1} - {:halt, acc1} - false -> - {[], acc1} - end - end) - |> Stream.run - receive do - {:data, ^ref, data} -> - assert String.match?(data, ~r/Message/) - after 10000 -> - flunk("timeout waiting for streamed log message") - end - end - test "run: streams messages for N seconds", context do ensure_log_file() time_before = System.system_time(:second) |