Skip to content
This repository has been archived by the owner on May 6, 2022. It is now read-only.

Fix RemoveFinalizerForBindings and RemoveBindingFinalizerByInstance tests #2591

Merged

Conversation

taragu
Copy link
Contributor

@taragu taragu commented Apr 1, 2019

This PR is a

  • Feature Implementation
  • Bug Fix
  • Documentation

What this PR does / why we need it:
@piotrmiskiewicz reported this problem to me earlier today. Because two goroutines of calling RemoveFinalizerForBinding are spawn from RemoveFinalizerForBindings, the order of get and update actions is indeterministic. This PR fixes the two tests of RemoveFinalizerForBindings and RemoveBindingFinalizerByInstance 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:

  • New feature
    • Tests
    • Documentation
  • SVCat CLI flag
  • Server Flag for config
    • Chart changes
    • removing a flag by marking deprecated and hiding to avoid
      breaking the chart release and existing clients who provide a
      flag that will get an error when they try to update

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 1, 2019
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Apr 1, 2019
@taragu
Copy link
Contributor Author

taragu commented Apr 1, 2019

/cc @piotrmiskiewicz

@k8s-ci-robot
Copy link
Contributor

@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:

/cc @piotrmiskiewicz

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.

@jberkhahn
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 2, 2019
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
Copy link
Contributor

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.

Copy link
Contributor Author

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 .

@taragu taragu force-pushed the fix-remove-finalizer-tests branch from e8a99bb to fe34b2a Compare April 2, 2019 22:19
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 2, 2019
@jberkhahn
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Apr 3, 2019
@jboyd01
Copy link
Contributor

jboyd01 commented Apr 8, 2019

/approve

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 8, 2019
@k8s-ci-robot k8s-ci-robot merged commit 2150e38 into kubernetes-retired:master Apr 8, 2019
viviyww pushed a commit to viviyww/service-catalog that referenced this pull request May 10, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants