Skip to content

Commit

Permalink
Attempting to fix an occasionally missing stdout from test.xml.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
olaola authored and aehlig committed Oct 6, 2017
1 parent ed0ebc0 commit 0ebb3e5
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/test/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 0ebb3e5

Please sign in to comment.