test: Fix random test failures at test/plugin/test_output.rb#L926 #1890
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This patch fixes the test failures around
invoke_slow_flush_log_thread_test()
whichhave been occurring at Travis CI.
For actual failing test runs, see job#4160.1, job#4169.4 and job#4154.5
Problem
I can reproduce this failure reliably by inserting
sleep 3
into test_output.rb:So it is a multi-threading bug. In particular, if the buffer-flushing thread interrupts the
test execution at the code point, it will accidentally turn on the
@test_finished
flagand breaks the precondition for the test case. This is the exact cause of the test failure.
Solution
This patch resolves this issue by setting a sufficiently long value to
flush_interval
(30 sec) so that it won't mess with the test execution.