Skip to content

Commit 0ebb3e5

Browse files
olaolaaehlig
authored andcommitted
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
1 parent ed0ebc0 commit 0ebb3e5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tools/test/test-setup.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,11 @@ for signal in $signals; do
212212
done
213213
start=$(date +%s)
214214

215+
set -o pipefail
215216
if [ -z "$COVERAGE_DIR" ]; then
216-
"${TEST_PATH}" "$@" 2> >(tee -a "${XML_OUTPUT_FILE}.log" >&2) 1> >(tee -a "${XML_OUTPUT_FILE}.log") 2>&1 || exitCode=$?
217+
"${TEST_PATH}" "$@" 2>&1 | tee "${XML_OUTPUT_FILE}.log" || exitCode=$?
217218
else
218-
"$1" "$TEST_PATH" "${@:3}" 2> >(tee -a "${XML_OUTPUT_FILE}.log" >&2) 1> >(tee -a "${XML_OUTPUT_FILE}.log") 2>&1 || exitCode=$?
219+
"$1" "$TEST_PATH" "${@:3}" 2>&1 | tee "${XML_OUTPUT_FILE}.log" || exitCode=$?
219220
fi
220221

221222
for signal in $signals; do

0 commit comments

Comments
 (0)