mirror of
https://github.com/ddworken/hishtory.git
synced 2024-12-23 23:39:02 +01:00
Refactor test retrying functions to make the number of retries configurable, and change the default to 3 retries (I'll be tuning this number in a follow up commit)
This commit is contained in:
parent
7b02d6f2a2
commit
af0234797c
@ -174,9 +174,10 @@ func TestParam(t *testing.T) {
|
||||
|
||||
func runTestsWithRetries(parentT *testing.T, testName string, testFunc func(t testing.TB)) {
|
||||
numRetries := 3
|
||||
if testutils.IsGithubAction() {
|
||||
numRetries = 5
|
||||
}
|
||||
runTestsWithExtraRetries(parentT, testName, testFunc, numRetries)
|
||||
}
|
||||
|
||||
func runTestsWithExtraRetries(parentT *testing.T, testName string, testFunc func(t testing.TB), numRetries int) {
|
||||
for i := 1; i <= numRetries; i++ {
|
||||
rt := &retryingTester{nil, i == numRetries, true}
|
||||
parentT.Run(fmt.Sprintf("%s/%d", testName, i), func(t *testing.T) {
|
||||
|
Loading…
Reference in New Issue
Block a user