MCPcopy Index your code
hub / github.com/ContentSquare/chproxy / newAsyncTestCache

Function newAsyncTestCache

cache/async_cache_test.go:189–210  ·  view source on GitHub ↗
(t *testing.T, graceTime, transactionEndedTime time.Duration)

Source from the content-addressed store, hash-verified

187}
188
189func newAsyncTestCache(t *testing.T, graceTime, transactionEndedTime time.Duration) *AsyncCache {
190 t.Helper()
191 cfg := config.Cache{
192 Name: "foobar",
193 FileSystem: config.FileSystemCacheConfig{
194 Dir: asyncTestDir,
195 MaxSize: 1e6,
196 },
197 Expire: config.Duration(time.Minute),
198 }
199 c, err := newFilesSystemCache(cfg, graceTime)
200 if err != nil {
201 t.Fatal(err)
202 }
203
204 asyncC := &AsyncCache{
205 Cache: c,
206 TransactionRegistry: newInMemoryTransactionRegistry(graceTime, transactionEndedTime),
207 graceTime: graceTime,
208 }
209 return asyncC
210}
211
212func TestAsyncCache_FilesystemCache_instantiation(t *testing.T) {
213 const testDirAsync = "./test-data-async"

Calls 3

DurationTypeAlias · 0.92
newFilesSystemCacheFunction · 0.85

Tested by

no test coverage detected