Commit bff46142 authored by Raphael 'kena' Poss's avatar Raphael 'kena' Poss

cli/interactive_tests: deflake test_missing_log_output

The test is asserting that a write error due to a closed stderr is
reported in the log _file_ when the logger is writing both to stderr
and files, prior to the server exiting.

However, this write error is only reported (and the server exited)
upon the first log output after stderr is closed. This "first next"
log output can occur on any logger, not just the main one.

Due to Pebble's different logging frequency, the switch to Pebble as
default storage engine causes Pebble to log first after stderr is
closed in this particular test. This makes the test flaky, because the
tests was waiting only on an error from the main (non-pebble) log

This patch fixes the flakiness by making the test wait on both log

Release note: None
parent ca72bf8c
......@@ -29,8 +29,13 @@ eexpect ":/# "
# NB: we can't just grep for the broken pipe output, because it may take
# a while for the server to initiate the next log line where it will detect
# the broken pipe error.
# We use -F and not -f because the log file may be rotated during the test.
send "tail -F logs/db/logs/cockroach.log\r"
# We also watch all the log files in the directory, because the error
# is only reported on the logger which is writing first after stderr
# is has been broken, and that may be the secondary logger.
send "tail -F `find logs/db/logs -type l`\r"
eexpect "log: exiting because of error: write /dev/stderr: broken pipe"
eexpect ":/# "
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment