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

cli/interactive_tests: tolerate log file rotations

Prior to this change, the test was waiting for a log line using `tail
-f cockroach.log`.

However, in certain cases the log file can be rotated (due to hitting
the max size) before the expected line is written. Since `tail -f`
watches the inode and not the file name, it can be left to wait
forever on a now-inactive log file.

This particular issue is fixed by using `tail -F` instead. The max
size on the log files is also increase for that test for good measure.

Release note: None
parent b710ead8
......@@ -21,14 +21,16 @@ eexpect ":/# "
end_test
start_test "Check that a broken stderr prints a message to the log files."
send "$argv start-single-node -s=path=logs/db --insecure --logtostderr --vmodule=*=1 2>&1 | cat\r"
# We use --log-file-max-size to avoid rotations during the test.
send "$argv start-single-node -s=path=logs/db --log-file-max-size=100M --insecure --logtostderr --vmodule=*=1 2>&1 | cat\r"
eexpect "CockroachDB node starting"
system "killall cat"
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.
send "tail -f logs/db/logs/cockroach.log\r"
# 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"
eexpect "log: exiting because of error: write /dev/stderr: broken pipe"
interrupt
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