extend fake clock
This commit is contained in:
@@ -43,7 +43,7 @@ import (
|
||||
// NewFakeControllerExpectationsLookup creates a fake store for PodExpectations.
|
||||
func NewFakeControllerExpectationsLookup(ttl time.Duration) (*ControllerExpectations, *util.FakeClock) {
|
||||
fakeTime := time.Date(2009, time.November, 10, 23, 0, 0, 0, time.UTC)
|
||||
fakeClock := &util.FakeClock{Time: fakeTime}
|
||||
fakeClock := util.NewFakeClock(fakeTime)
|
||||
ttlPolicy := &cache.TTLPolicy{Ttl: ttl, Clock: fakeClock}
|
||||
ttlStore := cache.NewFakeExpirationStore(
|
||||
ExpKeyFunc, nil, ttlPolicy, fakeClock)
|
||||
@@ -177,7 +177,7 @@ func TestControllerExpectations(t *testing.T) {
|
||||
}
|
||||
|
||||
// Expectations have expired because of ttl
|
||||
fakeClock.Time = fakeClock.Time.Add(ttl + 1)
|
||||
fakeClock.Step(ttl + 1)
|
||||
if !e.SatisfiedExpectations(rcKey) {
|
||||
t.Errorf("Expectations should have expired but didn't")
|
||||
}
|
||||
|
Reference in New Issue
Block a user