$BATS_TEST_RETRIES
–
Additional attempts to run flaky tests
$BATS_TEST_RETRIES
defines the number of additional attempts to run flaky tests.
The default value 0
indicates that tests are expected to pass at the first attempt.
Links
Examples
- Retry up to three times to run a flaky bats-core test
1 2 3 4 5
BATS_TEST_RETRIES=2 # additional attempts @test "Flaky test" { return "$(( RANDOM % 2 ))" }
BashSupport Pro is a shell script IDE with support for bats-core’s $BATS_TEST_RETRIES – try it now!