Skip to content

Commit 3687084

Browse files
jmmvcopybara-github
authored andcommitted
Fix test_interrupt_streamed_output_* flakiness.
This test waits for a Bazel subprocess to reach a point where it can be interrupted and then sends an interrupt to Bazel, expecting the process to exit cleanly. To do this, the test waits for the subprocess to print a message before entering a long sleep. The problem is that we do this twice within the same test. And this is a problem because the output redirection of the Bazel invocation happens in the subprocess too, so there is no guarantee that the redirection has already taken place on the next statement of the script. As a result, the second Bazel run we do could mistakely pick up the TEST_log of the previous attempt and assume Bazel had already reached the interruption point. To fix this, remove TEST_log before starting Bazel in the background so that we aren't confused by previous output. PiperOrigin-RevId: 331773152
1 parent 7e6553a commit 3687084

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/test/shell/integration/test_test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ eof
259259
function run_bazel_and_interrupt() {
260260
local exp_message="${1}"; shift
261261

262+
rm -f "${TEST_log}"
262263
bazel "${@}" >"${TEST_log}" 2>&1 &
263264
local bazel_pid="${!}"
264265
local timeout=60

0 commit comments

Comments
 (0)