MCPcopy
hub / github.com/grafana/dskit / TestDoBatchZeroInstances

Function TestDoBatchZeroInstances

ring/ring_test.go:194–209  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

192}
193
194func TestDoBatchZeroInstances(t *testing.T) {
195 ctx := context.Background()
196 numKeys := 10
197 keys := make([]uint32, numKeys)
198 rnd := rand.New(rand.NewSource(time.Now().UnixNano()))
199 generateKeys(rnd, numKeys, keys)
200 callback := func(InstanceDesc, []int) error {
201 return nil
202 }
203 cleanup := func() {
204 }
205 desc := NewDesc()
206 r := newRingForTesting(Config{}, false)
207 r.setRingStateFromDesc(desc, false, false, false)
208 require.Error(t, DoBatch(ctx, Write, r, keys, callback, cleanup))
209}
210
211func TestDoBatchWithOptionsContextCancellation(t *testing.T) {
212 const (

Callers

nothing calls this directly

Calls 6

generateKeysFunction · 0.85
NewDescFunction · 0.85
newRingForTestingFunction · 0.85
DoBatchFunction · 0.85
setRingStateFromDescMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected