Skip to content

Commit 63cc608

Browse files
committed
roachtest: metamorphically enable decommissioning nudger
This commit enables the decommissioning nudger metamorphically for two roachtests. I selected these two ad hoc — one is labeled as slow, and the other has been intermittently failing on master to improve observability and help root casue.
1 parent 527bff8 commit 63cc608

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

pkg/cmd/roachtest/tests/decommission.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,19 @@ func runDecommissionSlow(ctx context.Context, t test.Test, c cluster.Cluster) {
11351135
// Increase the speed of decommissioning.
11361136
run(db, `SET CLUSTER SETTING kv.snapshot_rebalance.max_rate='2GiB'`)
11371137

1138+
// Metamorphically enable the decommissioning nudger to get more test
1139+
// coverage on decommissioning nudger.
1140+
{
1141+
seed := timeutil.Now().UnixNano()
1142+
t.L().Printf("seed: %d", seed)
1143+
rng := rand.New(rand.NewSource(seed))
1144+
1145+
if rng.Intn(2) == 0 {
1146+
run(db, `SET CLUSTER SETTING kv.enqueue_in_replicate_queue_on_problem.interval = '10m'`)
1147+
t.L().Printf("metamorphically enabled decommissioning nudger")
1148+
}
1149+
}
1150+
11381151
// Wait for initial up-replication.
11391152
err := roachtestutil.WaitForReplication(ctx, t.L(), db, replicationFactor, roachprod.AtLeastReplicationFactor)
11401153
require.NoError(t, err)

pkg/cmd/roachtest/tests/multi_store_remove.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package tests
77

88
import (
99
"context"
10+
"math/rand"
1011
"time"
1112

1213
"github.com/cockroachdb/cockroach/pkg/cmd/roachtest/cluster"
@@ -104,6 +105,21 @@ func runMultiStoreRemove(ctx context.Context, t test.Test, c cluster.Cluster) {
104105
t.Fatal(err)
105106
}
106107

108+
// Metamorphically enable the decommissioning nudger to get more test coverage
109+
// on decommissioning nudger.
110+
{
111+
seed := timeutil.Now().UnixNano()
112+
t.L().Printf("seed: %d", seed)
113+
rng := rand.New(rand.NewSource(seed))
114+
115+
if rng.Intn(2) == 0 {
116+
if _, err := conn.ExecContext(ctx, `SET CLUSTER SETTING kv.enqueue_in_replicate_queue_on_problem.interval = '10m'`); err != nil {
117+
t.Fatal(err)
118+
}
119+
t.L().Printf("metamorphically enabled decommissioning nudger")
120+
}
121+
}
122+
107123
// Bring down node 1.
108124
t.Status("removing store from n1")
109125
node := c.Node(1)

0 commit comments

Comments
 (0)