Skip to content

Commit

Permalink
ensure negative cache is disabled when testing empty config for opc
Browse files Browse the repository at this point in the history
Signed-off-by: jnichols <mail@jnichols.info>
  • Loading branch information
jnichols-git committed Feb 10, 2024
1 parent 5fafeea commit 5f97081
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/proxy/engines/objectproxycache_chunk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,9 @@ func TestObjectProxyCacheRequestNegativeCacheChunks(t *testing.T) {
r = r.WithContext(tc.WithResources(r.Context(), request.NewResources(cfg, pc, rsc.CacheConfig,
rsc.CacheClient, rsc.BackendClient, nil, rsc.Logger)))

// Remove negative cache for first request
delete(cfg.NegativeCache, 404)

_, e := testFetchOPC(r, http.StatusNotFound, "test", map[string]string{"status": "kmiss"})
for _, err = range e {
t.Error(err)
Expand Down
3 changes: 3 additions & 0 deletions pkg/proxy/engines/objectproxycache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -798,6 +798,9 @@ func TestObjectProxyCacheRequestNegativeCache(t *testing.T) {
r = r.WithContext(tc.WithResources(r.Context(), request.NewResources(cfg, pc, rsc.CacheConfig,
rsc.CacheClient, rsc.BackendClient, nil, rsc.Logger)))

// Remove negative cache for first request
delete(cfg.NegativeCache, 404)

_, e := testFetchOPC(r, http.StatusNotFound, "test", map[string]string{"status": "kmiss"})
for _, err = range e {
t.Error(err)
Expand Down

0 comments on commit 5f97081

Please sign in to comment.