Skip to content

Commit 0e5d6bd

Browse files
committed
nightlies: run TestDataDriven once under cockroach_nightly_extra_stress_impl.sh
`TestDataDriven` in `pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go` is slow and doesn't add much value on CI, as it's datadriven and mainly checks for determinism. To reduce CI load, this commit adds a `skip_under_ci` flag to skip specific test files that take a long time to run during standard CI. To retain test coverage, we’ll continue running them once with a longer timeout in the Nightly Cockroach Extra Stress pipeline we recently introduced. Note that no test files set this flag yet. Future commits will handle that. Epic: none Release note: none
1 parent 1957a64 commit 0e5d6bd

File tree

3 files changed

+22
-0
lines changed

3 files changed

+22
-0
lines changed

build/teamcity/cockroach/nightlies/cockroach_nightly_extra_stress_impl.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,17 @@ bazel build //pkg/cmd/bazci
5555
BAZEL_BIN=$(bazel info bazel-bin)
5656

5757
exit_status=0
58+
59+
# Run TestDataDriven from the asim package once with COCKROACH_RUN_ASIM_TESTS enabled.
60+
$BAZEL_BIN/pkg/cmd/bazci/bazci_/bazci -- test //pkg/kv/kvserver/asim/tests:tests_test \
61+
--config=$BAZEL_CONFIG \
62+
--test_env TC_SERVER_URL \
63+
--test_env COCKROACH_RUN_ASIM_TESTS=true \
64+
--test_filter="^TestDataDriven$" \
65+
--test_timeout=3600 \
66+
|| exit_status=$?
67+
68+
# Run the rest of the tests under stress.
5869
$BAZEL_BIN/pkg/cmd/bazci/bazci_/bazci -- test $TEST_PACKAGE_TARGETS \
5970
--config=$BAZEL_CONFIG \
6071
--test_env TC_SERVER_URL \

pkg/kv/kvserver/asim/tests/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ go_test(
5050
"//pkg/spanconfig/spanconfigtestutils",
5151
"//pkg/testutils/datapathutils",
5252
"//pkg/testutils/skip",
53+
"//pkg/util/envutil",
5354
"@com_github_cockroachdb_datadriven//:datadriven",
5455
"@com_github_guptarohit_asciigraph//:asciigraph",
5556
"@com_github_stretchr_testify//require",

pkg/kv/kvserver/asim/tests/datadriven_simulation_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,14 @@ import (
2525
"github.com/cockroachdb/cockroach/pkg/spanconfig/spanconfigtestutils"
2626
"github.com/cockroachdb/cockroach/pkg/testutils/datapathutils"
2727
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
28+
"github.com/cockroachdb/cockroach/pkg/util/envutil"
2829
"github.com/cockroachdb/datadriven"
2930
"github.com/guptarohit/asciigraph"
3031
"github.com/stretchr/testify/require"
3132
)
3233

34+
var runAsimTests = envutil.EnvOrDefaultBool("COCKROACH_RUN_ASIM_TESTS", false)
35+
3336
// TestDataDriven is a data-driven test for the allocation system using the
3437
// simulator. It gives contributors a way to understand how a cluster reacts to
3538
// different settings, load and configuration. In addition, it may be used for
@@ -186,6 +189,12 @@ func TestDataDriven(t *testing.T) {
186189
require.Empty(t, d.CmdArgs, "leftover arguments for %s", d.Cmd)
187190
}()
188191
switch d.Cmd {
192+
case "skip_under_ci":
193+
if !runAsimTests {
194+
t.Logf("skipping %s: skip_under_ci and COCKROACH_RUN_ASIM_TESTS is not set", path)
195+
t.SkipNow()
196+
}
197+
return ""
189198
case "gen_load":
190199
var rwRatio, rate = 0.0, 0.0
191200
var minBlock, maxBlock = 1, 1
@@ -372,6 +381,7 @@ func TestDataDriven(t *testing.T) {
372381

373382
return ""
374383
case "eval":
384+
t.Logf("running eval for %s", path)
375385
samples := 1
376386
seed := rand.Int63()
377387
duration := 30 * time.Minute

0 commit comments

Comments
 (0)