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

Function TestMemcacheStop

pkg/chunk/cache/memcached_test.go:160–178  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

158}
159
160func TestMemcacheStop(t *testing.T) {
161 t.Run("unbatched", func(t *testing.T) {
162 client := newMockMemcacheFailing()
163 memcache := cache.NewMemcached(cache.MemcachedConfig{}, client,
164 "test", nil, log.NewNopLogger())
165
166 testMemcachedStopping(t, memcache)
167 })
168
169 t.Run("batched", func(t *testing.T) {
170 client := newMockMemcacheFailing()
171 memcache := cache.NewMemcached(cache.MemcachedConfig{
172 BatchSize: 10,
173 Parallelism: 5,
174 }, client, "test", nil, log.NewNopLogger())
175
176 testMemcachedStopping(t, memcache)
177 })
178}
179
180func testMemcachedStopping(t *testing.T, memcache *cache.Memcached) {
181 numKeys := 1000

Callers

nothing calls this directly

Calls 4

NewMemcachedFunction · 0.92
newMockMemcacheFailingFunction · 0.85
testMemcachedStoppingFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected