Skip to content

Commit f0a0d92

Browse files
author
Linus Arver
committed
cache_test: TestCallbacks: fix test case
Previously we always tried to create the same key multiple times. This was problematic because the cache size was 2, so we would never need to evict a key (we'd never run out of room).
1 parent a4f46b1 commit f0a0d92

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

prow/cache/cache_test.go

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -465,15 +465,16 @@ func TestCallbacks(t *testing.T) {
465465
cacheCallbacks: defaultCallbacks,
466466
lookups: []lookup{
467467
lookup{"(key)1", goodValConstructor},
468-
lookup{"(key)1", goodValConstructor},
469-
lookup{"(key)1", goodValConstructor},
470-
lookup{"(key)1", badValConstructor},
468+
lookup{"(key)2", goodValConstructor},
469+
lookup{"(key)3", goodValConstructor},
471470
lookup{"(key)1", badValConstructor},
471+
lookup{"(key)2", badValConstructor},
472+
lookup{"(key)3", badValConstructor},
472473
},
473474
expected: expected{
474-
lookups: 5,
475+
lookups: 6,
475476
hits: 0,
476-
misses: 5,
477+
misses: 0,
477478
forcedEvictions: 0,
478479
manualEvictions: 0,
479480
// If racyEvictions is true, then we expect some positive number of evictions to occur.

0 commit comments

Comments
 (0)