Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kvserver: deflake test merge queue #97086

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pkg/kv/kvserver/client_merge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4367,9 +4367,13 @@ func TestMergeQueue(t *testing.T) {
// NB: It is possible for the ranges being checked to record load
// during the test. To avoid flakiness, we set the splitByLoadStat high
// enough that any recorded load from testing won't exceed it.
// Likewise, when running under race - it is possible that if
// splitByLoadMergeDelay is small, enough time will pass in the test
// that this delay is elapsed and the ranges will merge when not
// expected to.
const splitByLoadStat = 10e9
const mergeByLoadStat = splitByLoadStat / 2 // see conservativeLoadBasedSplitThreshold
const splitByLoadMergeDelay = 500 * time.Millisecond
const splitByLoadMergeDelay = 1000 * time.Second

setSplitObjective := func(dim kvserver.LBRebalancingObjective) {
kvserver.LoadBasedRebalancingObjective.Override(ctx, sv, int64(dim))
Expand Down