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

Function writeValuesToKV

pkg/ring/kv/consul/client_test.go:23–36  ·  view source on GitHub ↗
(t *testing.T, client *Client, key string, start, end int, sleep time.Duration)

Source from the content-addressed store, hash-verified

21)
22
23func writeValuesToKV(t *testing.T, client *Client, key string, start, end int, sleep time.Duration) <-chan struct{} {
24 t.Helper()
25
26 ch := make(chan struct{})
27 go func() {
28 defer close(ch)
29 for i := start; i <= end; i++ {
30 t.Log("ts", time.Now(), "msg", "writing value", "val", i)
31 _, _ = client.kv.Put(&consul.KVPair{Key: key, Value: fmt.Appendf(nil, "%d", i)}, nil)
32 time.Sleep(sleep)
33 }
34 }()
35 return ch
36}
37
38func TestGetConsulConfig(t *testing.T) {
39 testCADir := t.TempDir()

Callers 2

TestWatchKeyNoRateLimitFunction · 0.85

Calls 2

PutMethod · 0.65
LogMethod · 0.45

Tested by

no test coverage detected