Skip to content

Commit daec0c8

Browse files
committed
mmaprototype: allow specifying limits for rebalanceStores in test
1 parent 9eed24a commit daec0c8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

pkg/kv/kvserver/allocator/mmaprototype/cluster_state_test.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,17 @@ func TestClusterState(t *testing.T) {
539539
defer tr.Close()
540540
ctx, finishAndGet := tracing.ContextWithRecordingSpan(context.Background(), tr, "rebalance-stores")
541541
re := newRebalanceEnv(cs, rng, dsm, cs.ts.Now())
542+
543+
if n, ok := dd.ScanArgOpt[int](t, d, "max-lease-transfer-count"); ok {
544+
re.maxLeaseTransferCount = n
545+
}
546+
if n, ok := dd.ScanArgOpt[int](t, d, "max-range-move-count"); ok {
547+
re.maxRangeMoveCount = n
548+
}
549+
if f, ok := dd.ScanArgOpt[float64](t, d, "fraction-pending-decrease-threshold"); ok {
550+
re.fractionPendingIncreaseOrDecreaseThreshold = f
551+
}
552+
542553
re.rebalanceStores(ctx, storeID)
543554
rec := finishAndGet()
544555
var sb redact.StringBuilder

0 commit comments

Comments
 (0)