aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/test
diff options
context:
space:
mode:
authorGravatar dmarting <dmarting@google.com>2017-11-22 08:58:41 -0800
committerGravatar Copybara-Service <copybara-piper@google.com>2017-11-22 09:01:08 -0800
commit0d6ff477099fdf6c8c1c7d4e2104f9184afe0a2b (patch)
treecee5a46f305c5210eb04e3a1043584850ca45645 /tools/test
parent69cb005beaad7f104617343de9c25acae28c2345 (diff)
Automated rollback of commit 0ebb3e54fc890946ae6b3d059ecbd50e4b5ec840.
*** Reason for rollback *** Cause rare case of test hanging. To cherry-pick for #3772 *** Original change description *** Attempting to fix an occasionally missing stdout from test.xml. In hello-world_test, when executed inside a docker container, for about 2% of the runs the test.xml has an empty CDATA, instead of the expected "Hello, world!". I'm not sure still what exactly was the bug, but in any case this change simplifies the test execution code line, so if this doesn't fix it, at least further debugging will be easier. I ran the test in a loop 1360 times, and the error did not reproduce once, which hints to... *** PiperOrigin-RevId: 176662654
Diffstat (limited to 'tools/test')
-rwxr-xr-xtools/test/test-setup.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh
index b1a85dfea4..3e357045e9 100755
--- a/tools/test/test-setup.sh
+++ b/tools/test/test-setup.sh
@@ -217,11 +217,10 @@ for signal in $signals; do
done
start=$(date +%s)
-set -o pipefail
if [ -z "$COVERAGE_DIR" ]; then
- "${TEST_PATH}" "$@" 2>&1 | tee "${XML_OUTPUT_FILE}.log" || exitCode=$?
+ "${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>&1 | tee "${XML_OUTPUT_FILE}.log" || exitCode=$?
+ "$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