Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions gocache/awscache/awscache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ func (env *testEnv) newCache(modify func(*Config)) *Cache {
type client struct {
t *testing.T
h *Handler
ts *httptest.Server
hc *cachers.HTTPClient
}

Expand All @@ -219,8 +220,9 @@ func (env *testEnv) newClient(c *Cache, g Grant) *client {
ts := httptest.NewServer(h)
env.t.Cleanup(ts.Close)
return &client{
t: env.t,
h: h,
t: env.t,
h: h,
ts: ts,
hc: &cachers.HTTPClient{
BaseURL: ts.URL,
Disk: &cachers.DiskCache{Dir: env.t.TempDir()},
Expand Down Expand Up @@ -473,6 +475,8 @@ func TestDiskSpool(t *testing.T) {
data := randBytes(1 << 20)
cl.put("abab01", "0a01", data)
cl.wantHit("abab01", "0a01", data)
cl.ts.Close()

ents, err := os.ReadDir(c.cfg.SpoolDir)
if err != nil {
t.Fatal(err)
Expand Down
Loading