Skip to content

Commit d0c3738

Browse files
authored
ci: Remove test retries (#1877)
1 parent 2aa48f2 commit d0c3738

File tree

2 files changed

+3
-40
lines changed

2 files changed

+3
-40
lines changed

scripts/build_test.sh

Lines changed: 3 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#!/usr/bin/env bash
22

3-
set -o errexit
4-
set -o nounset
5-
set -o pipefail
3+
set -euo pipefail
64
# TODO(marun) Ensure the working directory is the repository root or a non-canonical set of tests may be executed
75

86
# Root directory
@@ -22,38 +20,5 @@ if [[ -n "${NO_RACE:-}" ]]; then
2220
race=""
2321
fi
2422

25-
# MAX_RUNS bounds the attempts to retry the tests before giving up
26-
# This is useful for flaky tests
27-
MAX_RUNS=4
28-
for ((i = 1; i <= MAX_RUNS; i++));
29-
do
30-
# shellcheck disable=SC2046
31-
go test -shuffle=on ${race:-} -timeout="${TIMEOUT:-600s}" -coverprofile=coverage.out -covermode=atomic "$@" $(go list ./... | grep -v github.com/ava-labs/subnet-evm/tests) | tee test.out || command_status=$?
32-
33-
# If the test passed, exit
34-
if [[ ${command_status:-0} == 0 ]]; then
35-
rm test.out
36-
exit 0
37-
else
38-
unset command_status # Clear the error code for the next run
39-
fi
40-
41-
# If the test failed, print the output
42-
unexpected_failures=$(
43-
# First grep pattern corresponds to test failures, second pattern corresponds to test panics due to timeouts
44-
(grep "^--- FAIL" test.out | awk '{print $3}' || grep -E '^\s+Test.+ \(' test.out | awk '{print $1}') |
45-
sort -u | comm -23 - <(sed 's/\r$//' ./scripts/known_flakes.txt)
46-
)
47-
if [ -n "${unexpected_failures}" ]; then
48-
echo "Unexpected test failures: ${unexpected_failures}"
49-
exit 1
50-
fi
51-
52-
# Note the absence of unexpected failures cannot be indicative that we only need to run the tests that failed,
53-
# for example a test may panic and cause subsequent tests in that package to not run.
54-
# So we loop here.
55-
echo "Test run $i failed with known flakes, retrying..."
56-
done
57-
58-
# If we reach here, we have failed all retries
59-
exit 1
23+
# shellcheck disable=SC2046
24+
go test -shuffle=on ${race:-} -timeout="${TIMEOUT:-600s}" -coverprofile=coverage.out -covermode=atomic "$@" $(go list ./... | grep -v github.com/ava-labs/subnet-evm/tests)

scripts/known_flakes.txt

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)