Skip to content

Commit

Permalink
ci: don't delete test.json.txt after processing
Browse files Browse the repository at this point in the history
We've seen some issues where Bazel jobs are failing in `github-post`
(cockroachdb#73841, cockroachdb#74013) with the following output:

    found outstanding output. Considering last test failed:

It's hard to say what the problem is because these scripts haven't kept
the `test.json.txt` in `artifacts`. Here I remove the logic to clean up
the file so we can RC further instances of the problem.

Release note: None
  • Loading branch information
rickystewart committed Dec 21, 2021
1 parent fffe091 commit 4cca226
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
10 changes: 1 addition & 9 deletions build/teamcity-bazel-support.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ _tc_release_branch() {
# `$BAZEL_BIN/pkg/cmd/github-post/github-post_/github-post`
# artifacts_dir: usually `/artifacts`
# test_json: path to test's JSON output, usually generated by `rules_go`'s and
# `GO_TEST_JSON_OUTPUT_FILE`. The file is removed after processing.
# `GO_TEST_JSON_OUTPUT_FILE`.
# create_tarball: whether to create a tarball with full logs. If the test's
# exit code is passed, the tarball is generated on failures.
process_test_json() {
Expand All @@ -58,12 +58,6 @@ process_test_json() {
local test_json=$4
local create_tarball=$5

# move test.json.txt to the artifacts directory in order to simplify tarball creation
if [ ! -e $artifacts_dir/test.json.txt ]; then
mv -f $test_json $artifacts_dir/test.json.txt
test_json=$artifacts_dir/test.json.txt
fi

$testfilter -mode=strip < "$test_json" | $testfilter -mode=omit | $testfilter -mode=convert > "$artifacts_dir"/failures.txt
failures_size=$(stat --format=%s "$artifacts_dir"/failures.txt)
if [ $failures_size = 0 ]; then
Expand Down Expand Up @@ -103,8 +97,6 @@ process_test_json() {
rm -rf "$artifacts_dir"/full_output.txt
fi

rm -f "$test_json"

# Some unit tests test automatic ballast creation. These ballasts can be
# larger than the maximum artifact size. Remove any artifacts with the
# EMERGENCY_BALLAST filename.
Expand Down
2 changes: 1 addition & 1 deletion build/teamcity/cockroach/nightlies/stress_impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ fi
bazel build //pkg/cmd/bazci //pkg/cmd/github-post //pkg/cmd/testfilter --config=ci
BAZEL_BIN=$(bazel info bazel-bin --config=ci)
ARTIFACTS_DIR=/artifacts
GO_TEST_JSON_OUTPUT_FILE=$ARTIFACTS_DIR/test.json.txt

# Query to list all affected tests.
PKG=${PKG#"./"}
Expand All @@ -34,6 +33,7 @@ do
continue
fi
exit_status=0
GO_TEST_JSON_OUTPUT_FILE=$ARTIFACTS_DIR/$(echo "$test" | cut -d: -f2).test.json.txt
$BAZEL_BIN/pkg/cmd/bazci/bazci_/bazci --config=ci test "$test" -- \
--test_env=COCKROACH_NIGHTLY_STRESS=true \
--test_env=GO_TEST_JSON_OUTPUT_FILE=$GO_TEST_JSON_OUTPUT_FILE \
Expand Down

0 comments on commit 4cca226

Please sign in to comment.