Skip to content

Commit fb1dddb

Browse files
committed
Add factory start to the test
Signed-off-by: Yuriy Losev <yuriy.losev@flant.com>
1 parent a3fb18b commit fb1dddb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

vertical-pod-autoscaler/pkg/utils/limitrange/limit_range_calculator_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,9 @@ func TestGetContainerLimitRangeItem(t *testing.T) {
138138
cs := fake.NewSimpleClientset(tc.limitRanges...)
139139
factory := informers.NewSharedInformerFactory(cs, 0)
140140
lc, err := NewLimitsRangeCalculator(factory)
141+
142+
factory.Start(t.Context().Done())
143+
_ = factory.WaitForCacheSync(t.Context().Done())
141144
if assert.NoError(t, err) {
142145
limitRange, err := lc.GetContainerLimitRangeItem(testNamespace)
143146
if tc.expectedErr == nil {

0 commit comments

Comments
 (0)