github.com/thanos-io/thanos@v0.32.5/internal/cortex/chunk/cache/background_test.go (about)

     1  // Copyright (c) The Cortex Authors.
     2  // Licensed under the Apache License 2.0.
     3  
     4  package cache_test
     5  
     6  import (
     7  	"testing"
     8  
     9  	"github.com/thanos-io/thanos/internal/cortex/chunk/cache"
    10  )
    11  
    12  func TestBackground(t *testing.T) {
    13  	c := cache.NewBackground("mock", cache.BackgroundConfig{
    14  		WriteBackGoroutines: 1,
    15  		WriteBackBuffer:     100,
    16  	}, cache.NewMockCache(), nil)
    17  
    18  	keys, bufs := fillCache(t, c)
    19  	cache.Flush(c)
    20  
    21  	testCacheSingle(t, c, keys, bufs)
    22  	testCacheMultiple(t, c, keys, bufs)
    23  	testCacheMiss(t, c)
    24  }