@@ -105,15 +105,14 @@ func newEtcdTestStorage(t *testing.T, prefix string) (*etcd3testing.EtcdTestServ
105
105
return server , storage
106
106
}
107
107
108
- func newTestCacher (s storage.Interface , cap int ) (* cacherstorage.Cacher , storage.Versioner , error ) {
109
- return newTestCacherWithClock (s , cap , clock.RealClock {})
108
+ func newTestCacher (s storage.Interface ) (* cacherstorage.Cacher , storage.Versioner , error ) {
109
+ return newTestCacherWithClock (s , clock.RealClock {})
110
110
}
111
111
112
- func newTestCacherWithClock (s storage.Interface , cap int , clock clock.Clock ) (* cacherstorage.Cacher , storage.Versioner , error ) {
112
+ func newTestCacherWithClock (s storage.Interface , clock clock.Clock ) (* cacherstorage.Cacher , storage.Versioner , error ) {
113
113
prefix := "pods"
114
114
v := etcd3.APIObjectVersioner {}
115
115
config := cacherstorage.Config {
116
- CacheCapacity : cap ,
117
116
Storage : s ,
118
117
Versioner : v ,
119
118
ResourcePrefix : prefix ,
@@ -160,7 +159,7 @@ func updatePod(t *testing.T, s storage.Interface, obj, old *example.Pod) *exampl
160
159
func TestGet (t * testing.T ) {
161
160
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
162
161
defer server .Terminate (t )
163
- cacher , _ , err := newTestCacher (etcdStorage , 10 )
162
+ cacher , _ , err := newTestCacher (etcdStorage )
164
163
if err != nil {
165
164
t .Fatalf ("Couldn't create cacher: %v" , err )
166
165
}
@@ -194,7 +193,7 @@ func TestGet(t *testing.T) {
194
193
func TestGetToList (t * testing.T ) {
195
194
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
196
195
defer server .Terminate (t )
197
- cacher , _ , err := newTestCacher (etcdStorage , 10 )
196
+ cacher , _ , err := newTestCacher (etcdStorage )
198
197
if err != nil {
199
198
t .Fatalf ("Couldn't create cacher: %v" , err )
200
199
}
@@ -253,7 +252,7 @@ func TestGetToList(t *testing.T) {
253
252
func TestList (t * testing.T ) {
254
253
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
255
254
defer server .Terminate (t )
256
- cacher , _ , err := newTestCacher (etcdStorage , 10 )
255
+ cacher , _ , err := newTestCacher (etcdStorage )
257
256
if err != nil {
258
257
t .Fatalf ("Couldn't create cacher: %v" , err )
259
258
}
@@ -339,7 +338,7 @@ func TestList(t *testing.T) {
339
338
func TestTooLargeResourceVersionList (t * testing.T ) {
340
339
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
341
340
defer server .Terminate (t )
342
- cacher , v , err := newTestCacher (etcdStorage , 10 )
341
+ cacher , v , err := newTestCacher (etcdStorage )
343
342
if err != nil {
344
343
t .Fatalf ("Couldn't create cacher: %v" , err )
345
344
}
@@ -406,7 +405,7 @@ func TestWatch(t *testing.T) {
406
405
etcdStorage = & injectListError {errors : 1 , Interface : etcdStorage }
407
406
defer server .Terminate (t )
408
407
fakeClock := clock .NewFakeClock (time .Now ())
409
- cacher , _ , err := newTestCacherWithClock (etcdStorage , watchCacheDefaultCapacity , fakeClock )
408
+ cacher , _ , err := newTestCacherWithClock (etcdStorage , fakeClock )
410
409
if err != nil {
411
410
t .Fatalf ("Couldn't create cacher: %v" , err )
412
411
}
@@ -493,7 +492,7 @@ func TestWatch(t *testing.T) {
493
492
func TestWatcherTimeout (t * testing.T ) {
494
493
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
495
494
defer server .Terminate (t )
496
- cacher , _ , err := newTestCacher (etcdStorage , 10 )
495
+ cacher , _ , err := newTestCacher (etcdStorage )
497
496
if err != nil {
498
497
t .Fatalf ("Couldn't create cacher: %v" , err )
499
498
}
@@ -538,7 +537,7 @@ func TestWatcherTimeout(t *testing.T) {
538
537
func TestFiltering (t * testing.T ) {
539
538
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
540
539
defer server .Terminate (t )
541
- cacher , _ , err := newTestCacher (etcdStorage , 10 )
540
+ cacher , _ , err := newTestCacher (etcdStorage )
542
541
if err != nil {
543
542
t .Fatalf ("Couldn't create cacher: %v" , err )
544
543
}
@@ -603,7 +602,7 @@ func TestFiltering(t *testing.T) {
603
602
func TestStartingResourceVersion (t * testing.T ) {
604
603
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
605
604
defer server .Terminate (t )
606
- cacher , v , err := newTestCacher (etcdStorage , 10 )
605
+ cacher , v , err := newTestCacher (etcdStorage )
607
606
if err != nil {
608
607
t .Fatalf ("Couldn't create cacher: %v" , err )
609
608
}
@@ -668,7 +667,7 @@ func TestEmptyWatchEventCache(t *testing.T) {
668
667
669
668
fooCreated := updatePod (t , etcdStorage , makeTestPod ("foo" ), nil )
670
669
671
- cacher , v , err := newTestCacher (etcdStorage , 10 )
670
+ cacher , v , err := newTestCacher (etcdStorage )
672
671
if err != nil {
673
672
t .Fatalf ("Couldn't create cacher: %v" , err )
674
673
}
@@ -725,7 +724,7 @@ func TestEmptyWatchEventCache(t *testing.T) {
725
724
func TestRandomWatchDeliver (t * testing.T ) {
726
725
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
727
726
defer server .Terminate (t )
728
- cacher , v , err := newTestCacher (etcdStorage , 10 )
727
+ cacher , v , err := newTestCacher (etcdStorage )
729
728
if err != nil {
730
729
t .Fatalf ("Couldn't create cacher: %v" , err )
731
730
}
@@ -858,7 +857,7 @@ func TestWatchDispatchBookmarkEvents(t *testing.T) {
858
857
859
858
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
860
859
defer server .Terminate (t )
861
- cacher , v , err := newTestCacher (etcdStorage , 10 )
860
+ cacher , v , err := newTestCacher (etcdStorage )
862
861
if err != nil {
863
862
t .Fatalf ("Couldn't create cacher: %v" , err )
864
863
}
@@ -923,7 +922,7 @@ func TestWatchBookmarksWithCorrectResourceVersion(t *testing.T) {
923
922
924
923
server , etcdStorage := newEtcdTestStorage (t , etcd3testing .PathPrefix ())
925
924
defer server .Terminate (t )
926
- cacher , v , err := newTestCacher (etcdStorage , 10 )
925
+ cacher , v , err := newTestCacher (etcdStorage )
927
926
if err != nil {
928
927
t .Fatalf ("Couldn't create cacher: %v" , err )
929
928
}
0 commit comments