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

Function TestMemcache

pkg/chunk/cache/cache_test.go:98–112  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

96}
97
98func TestMemcache(t *testing.T) {
99 t.Run("Unbatched", func(t *testing.T) {
100 cache := cache.NewMemcached(cache.MemcachedConfig{}, newMockMemcache(),
101 "test", nil, log.NewNopLogger())
102 testCache(t, cache)
103 })
104
105 t.Run("Batched", func(t *testing.T) {
106 cache := cache.NewMemcached(cache.MemcachedConfig{
107 BatchSize: 10,
108 Parallelism: 3,
109 }, newMockMemcache(), "test", nil, log.NewNopLogger())
110 testCache(t, cache)
111 })
112}
113
114func TestFifoCache(t *testing.T) {
115 cache := cache.NewFifoCache("test", cache.FifoCacheConfig{MaxSizeItems: 1e3, Validity: 1 * time.Hour},

Callers

nothing calls this directly

Calls 3

newMockMemcacheFunction · 0.85
testCacheFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected