Store key in TimestampedEntry

Kubernetes-commit: 69fb4e960f7359641b3503b734acc32af6b05e04
This commit is contained in:
Ted Yu
2019-07-29 14:53:49 -07:00
committed by Kubernetes Publisher
parent ba8f4e8713
commit a865205fb0
2 changed files with 8 additions and 7 deletions

View File

@@ -168,7 +168,9 @@ func TestTTLPolicy(t *testing.T) {
expiredTime := fakeTime.Add(-(ttl + 1))
policy := TTLPolicy{ttl, clock.NewFakeClock(fakeTime)}
fakeTimestampedEntry := &TimestampedEntry{Obj: struct{}{}, Timestamp: exactlyOnTTL}
item := testStoreObject{id: "foo", val: "bar"}
itemkey, _ := testStoreKeyFunc(item)
fakeTimestampedEntry := &TimestampedEntry{Obj: item, Timestamp: exactlyOnTTL, key: itemkey}
if policy.IsExpired(fakeTimestampedEntry) {
t.Errorf("TTL cache should not expire entries exactly on ttl")
}