Skip to content

Commit fbab181

Browse files
authored
Merge 56e18ab into blathers/backport-release-24.3-161109
2 parents 622c2db + 56e18ab commit fbab181

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

pkg/cmd/ci-stress/main.go

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import (
1515
"path/filepath"
1616
"regexp"
1717
"slices"
18+
"strconv"
1819
"strings"
1920

2021
"github.com/cockroachdb/cockroach/pkg/util/buildutil"
@@ -134,8 +135,16 @@ func runTests(ctx context.Context, pkgToTests map[string][]string, extraBazelArg
134135
slices.Sort(allTestsSlice)
135136
testFilter := strings.Join(allTestsSlice, "|")
136137
testFilter = "^(" + testFilter + ")$"
137-
// Run each test multiple times.
138-
bazelArgs := []string{"test", "--test_filter", testFilter, "--runs_per_test", "10"}
138+
runsPerTest := 25
139+
// Run each test multiple times. Calculate the number of times based on
140+
// whether this is --race or not.
141+
for i := range extraBazelArgs {
142+
if extraBazelArgs[i] == "--config=race" ||
143+
(i < len(extraBazelArgs)-1 && extraBazelArgs[i] == "--config" && extraBazelArgs[i+1] == "race") {
144+
runsPerTest = 10
145+
}
146+
}
147+
bazelArgs := []string{"test", "--test_filter", testFilter, "--runs_per_test", strconv.Itoa(runsPerTest)}
139148
bazelArgs = append(bazelArgs, testPackages...)
140149
bazelArgs = append(bazelArgs, extraBazelArgs...)
141150
fmt.Printf("running `bazel` with args %+v\n", bazelArgs)

0 commit comments

Comments
 (0)