From 0d6ff477099fdf6c8c1c7d4e2104f9184afe0a2b Mon Sep 17 00:00:00 2001 From: dmarting Date: Wed, 22 Nov 2017 08:58:41 -0800 Subject: 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 --- tools/test/test-setup.sh | 5 ++--- 1 file 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 -- cgit v1.2.3