(cache cache.Cache)
| 27 | } |
| 28 | |
| 29 | func fillCache(cache cache.Cache) ([]string, [][]byte) { |
| 30 | // put a set of chunks, larger than background batch size, with varying timestamps and values |
| 31 | keys := []string{} |
| 32 | bufs := [][]byte{} |
| 33 | for i := 0; i < 111; i++ { |
| 34 | |
| 35 | buf := make([]byte, rand.Intn(100)) |
| 36 | _, err := crand.Read(buf) |
| 37 | if err != nil { |
| 38 | panic(err) |
| 39 | } |
| 40 | |
| 41 | keys = append(keys, strconv.Itoa(i)) |
| 42 | bufs = append(bufs, buf) |
| 43 | } |
| 44 | |
| 45 | cache.Store(context.Background(), keys, bufs) |
| 46 | return keys, bufs |
| 47 | } |
| 48 | |
| 49 | func testCacheSingle(t *testing.T, cache cache.Cache, keys []string, bufs [][]byte) { |
| 50 | for i := 0; i < 100; i++ { |
no test coverage detected