(t *testing.T, graceTime, transactionEndedTime time.Duration)
| 187 | } |
| 188 | |
| 189 | func 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 | |
| 212 | func TestAsyncCache_FilesystemCache_instantiation(t *testing.T) { |
| 213 | const testDirAsync = "./test-data-async" |
no test coverage detected