MCPcopy Create free account
hub / github.com/cortexproject/cortex / TestShuffleShardExpectedInstances

Function TestShuffleShardExpectedInstances

pkg/util/shard_test.go:47–83  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

45}
46
47func TestShuffleShardExpectedInstances(t *testing.T) {
48 tests := []struct {
49 shardSize int
50 numZones int
51 expected int
52 }{
53 {
54 shardSize: 1,
55 numZones: 1,
56 expected: 1,
57 },
58 {
59 shardSize: 1,
60 numZones: 3,
61 expected: 3,
62 },
63 {
64 shardSize: 3,
65 numZones: 3,
66 expected: 3,
67 },
68 {
69 shardSize: 4,
70 numZones: 3,
71 expected: 6,
72 },
73 {
74 shardSize: 6,
75 numZones: 3,
76 expected: 6,
77 },
78 }
79
80 for _, test := range tests {
81 assert.Equal(t, test.expected, ShuffleShardExpectedInstances(test.shardSize, test.numZones))
82 }
83}
84
85func TestDynamicShardSize(t *testing.T) {
86 tests := []struct {

Callers

nothing calls this directly

Calls 2

EqualMethod · 0.65

Tested by

no test coverage detected