diff options
author | Googler <noreply@google.com> | 2018-02-12 21:49:47 -0800 |
---|---|---|
committer | Copybara-Service <copybara-piper@google.com> | 2018-02-12 21:51:56 -0800 |
commit | 3904ac33a983fd8faebba1b52bcac5a3ff942029 (patch) | |
tree | 1c2e7b1e0b48aa977f5251d48ec9497177f34ba8 /tools/test | |
parent | bcefd9833cb5620fef8a27c37c2808a66b57c7e6 (diff) |
Automated rollback of commit 28bd997c1c8793973f63dcae4c22bbae49e7d8b7.
*** Reason for rollback ***
https://github.com/bazelbuild/bazel/issues/4625
What I thought was a short fix is turning into a long hunt, so I better roll this back to get the build green again.
I'm not yet 100% certain what the interactions are, but there's a chance that it's back to the drawing board.
*** Original change description ***
Fixing test-setup.sh occasionally missing stdout/stderr, on systems where "tail --pid" is supported.
The solutions aren't mine, the new test was taken from Ola's unknown commit and the way to avoid race condition courtesy of sethkoehler@
Mitigates #4608 for compatible Linux systems.
TESTED=manual scripts and new test case.
RELNOTES: None
PiperOrigin-RevId: 185482604
Diffstat (limited to 'tools/test')
-rwxr-xr-x | tools/test/test-setup.sh | 26 |
1 files changed, 3 insertions, 23 deletions
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh index 328972fe6a..aa6f7223b8 100755 --- a/tools/test/test-setup.sh +++ b/tools/test/test-setup.sh @@ -218,30 +218,10 @@ for signal in $signals; do done start=$(date +%s) -# Check if we have tail --pid option -dummy=1 & -pid=$! -has_tail=true -tail -fq --pid $pid -s 0.001 /dev/null &> /dev/null || has_tail=false - -if [ "$has_tail" == true ] && [ -z "$no_echo" ]; then - touch "${XML_OUTPUT_FILE}.log" - if [ -z "$COVERAGE_DIR" ]; then - "${TEST_PATH}" "$@" &>"${XML_OUTPUT_FILE}.log" & - pid=$! - else - "$1" "$TEST_PATH" "${@:3}" &> "${XML_OUTPUT_FILE}.log" & - pid=$! - fi - tail -fq --pid $pid -s 0.001 "${XML_OUTPUT_FILE}.log" - wait $pid - exitCode=$? +if [ -z "$COVERAGE_DIR" ]; then + "${TEST_PATH}" "$@" 2> >(tee -a "${XML_OUTPUT_FILE}.log" >&2) 1> >(tee -a "${XML_OUTPUT_FILE}.log") 2>&1 || exitCode=$? else - if [ -z "$COVERAGE_DIR" ]; then - "${TEST_PATH}" "$@" 2> >(tee -a "${XML_OUTPUT_FILE}.log" >&2) 1> >(tee -a "${XML_OUTPUT_FILE}.log") 2>&1 || exitCode=$? - else - "$1" "$TEST_PATH" "${@:3}" 2> >(tee -a "${XML_OUTPUT_FILE}.log" >&2) 1> >(tee -a "${XML_OUTPUT_FILE}.log") 2>&1 || exitCode=$? - fi + "$1" "$TEST_PATH" "${@:3}" 2> >(tee -a "${XML_OUTPUT_FILE}.log" >&2) 1> >(tee -a "${XML_OUTPUT_FILE}.log") 2>&1 || exitCode=$? fi for signal in $signals; do |