diff --git a/.aspect/workflows/bazelrc b/.aspect/workflows/bazelrc index 33fb1ce4..a9ea9ff5 100644 --- a/.aspect/workflows/bazelrc +++ b/.aspect/workflows/bazelrc @@ -9,3 +9,6 @@ common:rbe --remote_executor=unix:///mnt/ephemeral/buildbarn/.cache/bb_clientd/g common:rbe --genrule_strategy=remote,local common:rbe --jobs=32 common:rbe --remote_timeout=3600 + +# retry flaky tests +common --flaky_test_attempts=5 \ No newline at end of file diff --git a/BUILD.bazel b/BUILD.bazel index e8bc8110..8c77cddc 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -31,3 +31,12 @@ js_library( ":node_modules/typescript-eslint", ], ) + +sh_test( + name = "flaky_sh_test", + srcs = ["flake.sh"], + flaky = True, + tags = [ + "expected_to_fail", + ], +) diff --git a/flake.sh b/flake.sh new file mode 100755 index 00000000..5212a087 --- /dev/null +++ b/flake.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +set -o errexit + +COUNT=$((RANDOM%3)) +echo $COUNT + +if [[ "${COUNT}" == "0" ]]; then + exit 0 +else + exit 1 +fi