@@ -61,7 +61,7 @@ import (
61
61
"k8s.io/utils/pointer"
62
62
)
63
63
64
- func newTestCacherWithoutSyncing (s storage.Interface ) (* Cacher , storage.Versioner , error ) {
64
+ func newTestCacherWithoutSyncing (s storage.Interface , c clock. WithTicker ) (* Cacher , storage.Versioner , error ) {
65
65
prefix := "pods"
66
66
config := Config {
67
67
Storage : s ,
@@ -85,15 +85,15 @@ func newTestCacherWithoutSyncing(s storage.Interface) (*Cacher, storage.Versione
85
85
NewFunc : func () runtime.Object { return & example.Pod {} },
86
86
NewListFunc : func () runtime.Object { return & example.PodList {} },
87
87
Codec : codecs .LegacyCodec (examplev1 .SchemeGroupVersion ),
88
- Clock : clock. RealClock {} ,
88
+ Clock : c ,
89
89
}
90
90
cacher , err := NewCacherFromConfig (config )
91
91
92
92
return cacher , storage.APIObjectVersioner {}, err
93
93
}
94
94
95
95
func newTestCacher (s storage.Interface ) (* Cacher , storage.Versioner , error ) {
96
- cacher , versioner , err := newTestCacherWithoutSyncing (s )
96
+ cacher , versioner , err := newTestCacherWithoutSyncing (s , clock. RealClock {} )
97
97
if err != nil {
98
98
return nil , versioner , err
99
99
}
@@ -625,7 +625,7 @@ func TestTooManyRequestsNotReturned(t *testing.T) {
625
625
626
626
dummyErr := fmt .Errorf ("dummy" )
627
627
backingStorage := & dummyStorage {err : dummyErr }
628
- cacher , _ , err := newTestCacherWithoutSyncing (backingStorage )
628
+ cacher , _ , err := newTestCacherWithoutSyncing (backingStorage , clock. RealClock {} )
629
629
if err != nil {
630
630
t .Fatalf ("Couldn't create cacher: %v" , err )
631
631
}
@@ -752,7 +752,7 @@ func TestWatchNotHangingOnStartupFailure(t *testing.T) {
752
752
// constantly failing lists to the underlying storage.
753
753
dummyErr := fmt .Errorf ("dummy" )
754
754
backingStorage := & dummyStorage {err : dummyErr }
755
- cacher , _ , err := newTestCacherWithoutSyncing (backingStorage )
755
+ cacher , _ , err := newTestCacherWithoutSyncing (backingStorage , clock. RealClock {} )
756
756
if err != nil {
757
757
t .Fatalf ("Couldn't create cacher: %v" , err )
758
758
}
0 commit comments