Skip to content

Commit

Permalink
v1.21: Fix test flake in old svc registry
Browse files Browse the repository at this point in the history
  • Loading branch information
thockin committed Sep 17, 2021
1 parent 4dac5c1 commit 0c05026
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions test/e2e/network/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -2373,15 +2373,19 @@ var _ = common.SIGDescribe("Services", func() {
framework.Logf("Service %s has service status updated", testSvcName)

ginkgo.By("patching the service")
servicePatchPayload, err := json.Marshal(v1.Service{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"test-service": "patched",
err = retry.RetryOnConflict(retry.DefaultRetry, func() error {
servicePatchPayload, err := json.Marshal(v1.Service{
ObjectMeta: metav1.ObjectMeta{
Labels: map[string]string{
"test-service": "patched",
},
},
},
})
})
framework.ExpectNoError(err, "failed to marshal patch for Service %v in namespace %v", testSvcName, ns)

_, err = svcClient.Patch(context.TODO(), testSvcName, types.StrategicMergePatchType, []byte(servicePatchPayload), metav1.PatchOptions{})
_, err = svcClient.Patch(context.TODO(), testSvcName, types.StrategicMergePatchType, []byte(servicePatchPayload), metav1.PatchOptions{})
return err
})
framework.ExpectNoError(err, "failed to patch service. %v", err)

ginkgo.By("watching for the Service to be patched")
Expand Down

0 comments on commit 0c05026

Please sign in to comment.