Skip to content

Commit 4b6268f

Browse files
committed
roachtest: fix test cluster check in maybeSaveClusterDueToInvariantProblems
This check previously called c.Nodes, which constructs a node list with the passed in options. With nothing passed, this constructs an empty node list which caused this check to always return.
1 parent 165e40b commit 4b6268f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pkg/cmd/roachtest/test_runner.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1814,7 +1814,7 @@ func gatherFatalNodeLogs(t *testImpl, testLogger *logger.Logger) (string, error)
18141814
func (r *testRunner) maybeSaveClusterDueToInvariantProblems(
18151815
ctx context.Context, t *testImpl, c *clusterImpl,
18161816
) {
1817-
if len(c.Nodes()) == 0 {
1817+
if len(c.All()) == 0 {
18181818
return // test only
18191819
}
18201820
dets, err := c.RunWithDetails(ctx, t.L(), option.WithNodes(c.All()),

pkg/cmd/roachtest/tests/invariant_check_detection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func registerInvariantCheckDetection(r registry.Registry) {
3030
Name: fmt.Sprintf("invariant-check-detection/failed=%t", failed),
3131
Owner: registry.OwnerTestEng,
3232
Suites: registry.ManualOnly,
33-
Cluster: spec.ClusterSpec{NodeCount: 1, CPUs: 4, ReusePolicy: spec.ReusePolicyNone{}},
33+
Cluster: r.MakeClusterSpec(1, spec.CPU(4), spec.ReuseNone(), spec.VolumeSize(100), spec.GCEVolumeType("pd-ssd")),
3434
Run: func(ctx context.Context, t test.Test, c cluster.Cluster) {
3535
runInvariantCheckDetection(ctx, t, c, failed)
3636
},

0 commit comments

Comments
 (0)