-
Notifications
You must be signed in to change notification settings - Fork 382
Fix RemoveFinalizerForBindings and RemoveBindingFinalizerByInstance tests #2591
Fix RemoveFinalizerForBindings and RemoveBindingFinalizerByInstance tests #2591
Conversation
/cc @piotrmiskiewicz |
@taragu: GitHub didn't allow me to request PR reviews from the following users: piotrmiskiewicz. Note that only kubernetes-incubator members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/lgtm |
Expect(actions[2].Matches("update", "servicebindings")).To(BeTrue()) | ||
Expect(actions[2].(testing.UpdateActionImpl).Object.(*v1beta1.ServiceBinding).ObjectMeta.Name).To(Equal(sb.ObjectMeta.Name)) | ||
Expect(actions[2].(testing.UpdateActionImpl).Object.(*v1beta1.ServiceBinding).ObjectMeta.Namespace).To(Equal(sb.ObjectMeta.Namespace)) | ||
// For the remaining actions, one should be get and the other one should be update |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there is no need to use the pattern from the previous change. Correct me if I'm wrong, but always the "get" action will be done before the "update". The problem occurs when there are two concurrent execution, but there is only one. I think the change is not necessary, but of course the test is green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@piotrmiskiewicz Yeah you are right. Here's only one service binding to be removed and therefore no concurrent issue comparing to the test for RemoveFinalizerForBindings
.
e8a99bb
to
fe34b2a
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jboyd01 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR is a
What this PR does / why we need it:
@piotrmiskiewicz reported this problem to me earlier today. Because two goroutines of calling
RemoveFinalizerForBinding
are spawn fromRemoveFinalizerForBindings
, the order ofget
andupdate
actions is indeterministic. This PR fixes the two tests ofRemoveFinalizerForBindings
andRemoveBindingFinalizerByInstance
that are affected by this problem.Which issue(s) this PR fixes
Fixes #
Please leave this checklist in the PR comment so that maintainers can ensure a good PR.
Merge Checklist:
breaking the chart release and existing clients who provide a
flag that will get an error when they try to update