Skip to content

Commit 44480bb

Browse files
committed
kvserver: fix test merge queue when grunning unsupported
`TestMergeQueue/load-based-merging/switch...below-threshold` asserts that switching the split objective between CPU and QPS will not cause range's to merge, even if their pre-switch load qualified them for merging. This test was broken when `grunning` was unsupported, as the objective never actually switches to anything other than QPS. Add a check for `grunning` support, and assert that a merge occurs if unsupported. Fixes: cockroachdb#106937 Epic: none Release note: None
1 parent 1d3c11e commit 44480bb

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

pkg/kv/kvserver/client_merge_test.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import (
5555
"github.com/cockroachdb/cockroach/pkg/testutils/skip"
5656
"github.com/cockroachdb/cockroach/pkg/testutils/testcluster"
5757
"github.com/cockroachdb/cockroach/pkg/util/ctxgroup"
58+
"github.com/cockroachdb/cockroach/pkg/util/grunning"
5859
"github.com/cockroachdb/cockroach/pkg/util/hlc"
5960
"github.com/cockroachdb/cockroach/pkg/util/leaktest"
6061
"github.com/cockroachdb/cockroach/pkg/util/log"
@@ -4525,7 +4526,14 @@ func TestMergeQueue(t *testing.T) {
45254526

45264527
clearRange(t, lhsStartKey, rhsEndKey)
45274528
setSplitObjective(secondSplitObjective)
4528-
verifyUnmergedSoon(t, store, lhsStartKey, rhsStartKey)
4529+
if !grunning.Supported() {
4530+
// CPU isn't a supported split objective when grunning isn't
4531+
// supported. Switching the dimension will have no effect, as the
4532+
// objective gets overridden in such cases to always be QPS.
4533+
verifyMergedSoon(t, store, lhsStartKey, rhsStartKey)
4534+
} else {
4535+
verifyUnmergedSoon(t, store, lhsStartKey, rhsStartKey)
4536+
}
45294537
})
45304538
}
45314539
}

0 commit comments

Comments
 (0)