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

Function testCacheMiss

pkg/chunk/cache/cache_test.go:75–83  ·  view source on GitHub ↗
(t *testing.T, cache cache.Cache)

Source from the content-addressed store, hash-verified

73}
74
75func testCacheMiss(t *testing.T, cache cache.Cache) {
76 for range 100 {
77 key := strconv.Itoa(rand.Int()) // arbitrary key which should fail: no chunk key is a single integer
78 found, bufs, missing := cache.Fetch(context.Background(), []string{key})
79 require.Empty(t, found)
80 require.Empty(t, bufs)
81 require.Len(t, missing, 1)
82 }
83}
84
85func testCache(t *testing.T, cache cache.Cache) {
86 keys, chunks := fillCache(t, cache)

Callers 2

TestBackgroundFunction · 0.85
testCacheFunction · 0.85

Calls 2

FetchMethod · 0.65
LenMethod · 0.45

Tested by

no test coverage detected