Skip to content

Commit 1142db4

Browse files
committed
fix unit tests
Signed-off-by: Albert <ac1214@users.noreply.github.com>
1 parent eb4b34d commit 1142db4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pkg/compactor/shuffle_sharding_grouper_test.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66

77
"github.com/oklog/ulid"
88
"github.com/prometheus/client_golang/prometheus"
9+
"github.com/prometheus/client_golang/prometheus/promauto"
910
"github.com/prometheus/prometheus/tsdb"
1011
"github.com/stretchr/testify/assert"
1112
"github.com/stretchr/testify/require"
@@ -142,14 +143,20 @@ func TestShuffleShardingGrouper_Groups(t *testing.T) {
142143
BlockRanges: testData.ranges,
143144
}
144145

146+
registerer := prometheus.NewRegistry()
147+
remainingPlannedCompactions := promauto.With(registerer).NewGauge(prometheus.GaugeOpts{
148+
Name: "cortex_compactor_remaining_planned_compactions",
149+
Help: "Total number of plans that remain to be compacted.",
150+
})
151+
145152
g := NewShuffleShardingGrouper(nil,
146153
nil,
147154
false, // Do not accept malformed indexes
148155
true, // Enable vertical compaction
149-
prometheus.NewRegistry(),
150-
nil,
156+
registerer,
151157
nil,
152158
nil,
159+
remainingPlannedCompactions,
153160
metadata.NoneFunc,
154161
*compactorCfg)
155162
actual, err := g.Groups(testData.blocks)

0 commit comments

Comments
 (0)