You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# TODO(marun) Ensure the working directory is the repository root or a non-canonical set of tests may be executed
7
5
8
6
# Root directory
@@ -22,38 +20,5 @@ if [[ -n "${NO_RACE:-}" ]]; then
22
20
race=""
23
21
fi
24
22
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
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)
0 commit comments