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.
This commit is contained in:
Michael Klishin 2019-08-11 13:20:19 +10:00
parent f4be415e3b
commit 5b1086156e
1 changed files with 0 additions and 29 deletions

View File

@ -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)