UPSTREAM: 76455: More flake fixes in HPA legacy tests
@@ -332,6 +332,7 @@ func (tc *legacyTestCase) prepareTestClient(t *testing.T) (*fake.Clientset, *sca
})
fakeClient.AddReactor("update", "horizontalpodautoscalers", func(action core.Action) (handled bool, ret runtime.Object, err error) {
+ obj := func() *autoscalingv1.HorizontalPodAutoscaler {
tc.Lock()
defer tc.Unlock()
@@ -345,6 +346,8 @@ func (tc *legacyTestCase) prepareTestClient(t *testing.T) (*fake.Clientset, *sca
}
}
tc.statusUpdated = true
+ return obj
+ }()
// Every time we reconcile HPA object we are updating status.
tc.processed <- obj.Name
return true, obj, nil
