diff options
author | olaola <olaola@google.com> | 2017-10-02 16:56:44 +0200 |
---|---|---|
committer | Klaus Aehlig <aehlig@google.com> | 2017-10-06 19:37:50 +0200 |
commit | 0ebb3e54fc890946ae6b3d059ecbd50e4b5ec840 (patch) | |
tree | 3a4bd24ce45f77d0147af39c3fd6dfd965614e39 /tools/test | |
parent | ed0ebc084b67b8f2c3242ade4f2dd50d4109d46e (diff) |
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 towards this fixing it, since for an unpatched Bazel it reproduced 7 times out of 293 runs.
TESTED=ran Bazel test in a loop
RELNOTES: None
PiperOrigin-RevId: 170702015
Diffstat (limited to 'tools/test')
-rwxr-xr-x | tools/test/test-setup.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh index 5eb43a0bdd..48788cc115 100755 --- a/tools/test/test-setup.sh +++ b/tools/test/test-setup.sh @@ -212,10 +212,11 @@ for signal in $signals; do done start=$(date +%s) +set -o pipefail 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=$? + "${TEST_PATH}" "$@" 2>&1 | tee "${XML_OUTPUT_FILE}.log" || exitCode=$? else - "$1" "$TEST_PATH" "${@:3}" 2> >(tee -a "${XML_OUTPUT_FILE}.log" >&2) 1> >(tee -a "${XML_OUTPUT_FILE}.log") 2>&1 || exitCode=$? + "$1" "$TEST_PATH" "${@:3}" 2>&1 | tee "${XML_OUTPUT_FILE}.log" || exitCode=$? fi for signal in $signals; do |