Skip to content

Commit 22e573c

Browse files
committed
stress: rename Stress to DevStress
This renames the current implementation of Stress to DevStress and then adds a new (unused) Stress function that covers both local and nightly stress runs. Epic: none Release note: None
1 parent fe15853 commit 22e573c

File tree

6 files changed

+24
-17
lines changed

6 files changed

+24
-17
lines changed

pkg/backup/restore_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func TestRestoreRetryFastFails(t *testing.T) {
107107
// runtime does not exceed the max duration of the retry policy, or
108108
// else very few attempts will be made.
109109
maxDuration := 500 * time.Millisecond
110-
if skip.Stress() {
110+
if skip.DevStress() {
111111
// Under stress, the restore will take longer to complete, so we need to
112112
// increase max duration accordingly.
113113
maxDuration = 1500 * time.Millisecond

pkg/ccl/kvccl/kvtenantccl/upgradeinterlockccl/local_test_util_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func runTest(t *testing.T, variant sharedtestutil.TestVariant, test sharedtestut
107107
// extend the TTL by 10x to handle cases where the system is too
108108
// overloaded to heartbeat at sub-second intervals.
109109
ttlOverride := 250 * time.Millisecond
110-
if skip.Stress() {
110+
if skip.DevStress() {
111111
ttlOverride *= 10
112112
}
113113
heartbeatOverride := ttlOverride / 10

pkg/crosscluster/replicationtestutils/testutils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -582,7 +582,7 @@ func (c *TenantStreamingClusters) SrcExec(exec srcInitExecFunc) {
582582

583583
func WaitUntilStartTimeReached(t *testing.T, db *sqlutils.SQLRunner, ingestionJobID jobspb.JobID) {
584584
timeout := 45 * time.Second
585-
if skip.Stress() || util.RaceEnabled {
585+
if skip.DevStress() || util.RaceEnabled {
586586
timeout *= 5
587587
}
588588
testutils.SucceedsWithin(t, func() error {

pkg/sql/mvcc_statistics_update_job_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ func TestTenantGlobalAggregatedLivebytes(t *testing.T) {
203203
// Exact match for non stress tests, and allow values to differ by up to
204204
// 5% in stress situations.
205205
confidenceLevel := 0.0
206-
if skip.Stress() {
206+
if skip.DevStress() {
207207
confidenceLevel = 0.05
208208
}
209209
testutils.SucceedsSoon(t, func() error {

pkg/testutils/skip/skip.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ func UnderShort(t SkippableTest, args ...interface{}) {
127127
// UnderStress skips this test when running under stress.
128128
func UnderStress(t SkippableTest, args ...interface{}) {
129129
t.Helper()
130-
if Stress() {
130+
if DevStress() {
131131
maybeSkip(t, "disabled under stress", args...)
132132
}
133133
}
@@ -136,7 +136,7 @@ func UnderStress(t SkippableTest, args ...interface{}) {
136136
// given issue ID as the reason.
137137
func UnderStressWithIssue(t SkippableTest, githubIssueID int, args ...interface{}) {
138138
t.Helper()
139-
if Stress() {
139+
if DevStress() {
140140
maybeSkip(t, withIssue("disabled under stress", githubIssueID), args...)
141141
}
142142
}
@@ -188,10 +188,10 @@ func UnderDuressWithIssue(t SkippableTest, githubIssueID int, args ...interface{
188188
}
189189
}
190190

191-
// Duress catures the conditions that currently lead us to
192-
// believe that tests may be slower than normal.
191+
// Duress captures the conditions that currently lead us to believe that tests
192+
// may be slower than normal.
193193
func Duress() bool {
194-
return util.RaceEnabled || Stress() || syncutil.DeadlockEnabled
194+
return util.RaceEnabled || DevStress() || syncutil.DeadlockEnabled
195195
}
196196

197197
// UnderBench returns true iff a test is currently running under `go
@@ -225,7 +225,7 @@ func OnArch(t SkippableTest, arch string, args ...interface{}) {
225225

226226
func testConfig() string {
227227
configs := []string{}
228-
if Stress() {
228+
if DevStress() {
229229
configs = append(configs, "stress")
230230
}
231231
if util.RaceEnabled {

pkg/testutils/skip/stress.go

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@ package skip
77

88
import "github.com/cockroachdb/cockroach/pkg/util/envutil"
99

10-
var nightlyStress = envutil.EnvOrDefaultBool("COCKROACH_NIGHTLY_STRESS", false)
10+
var (
11+
nightlyStress = envutil.EnvOrDefaultBool("COCKROACH_NIGHTLY_STRESS", false)
12+
stress = envutil.EnvOrDefaultBool("COCKROACH_STRESS", false)
13+
)
1114

12-
var stress = envutil.EnvOrDefaultBool("COCKROACH_STRESS", false)
13-
14-
// NightlyStress returns true iff the process is running as part of CockroachDB's
15-
// nightly stress tests.
15+
// NightlyStress returns true iff the process is running as part of
16+
// CockroachDB's nightly stress tests.
1617
func NightlyStress() bool {
1718
return nightlyStress
1819
}
1920

20-
// Stress returns true iff the process is running under a local _dev_ instance of the stress, i.e., ./dev test ... --stress
21-
func Stress() bool {
21+
// DevStress returns true iff the process is running under a local _dev_ instance
22+
// of the stress, i.e., ./dev test ... --stress
23+
func DevStress() bool {
2224
return stress
2325
}
26+
27+
// Stress returns true iff the process is running under local or nightly stress.
28+
func Stress() bool {
29+
return DevStress() || NightlyStress()
30+
}

0 commit comments

Comments
 (0)