-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bug 2015624: Refactor IBM Cloud skips to External #26537
Conversation
@cjschaef: This pull request references Bugzilla bug 2015624, which is invalid:
Comment 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. |
a87cae2
to
c6114a0
Compare
@@ -250,16 +252,19 @@ func (test resourceAccessReviewTest) run() { | |||
} | |||
} | |||
|
|||
infra, err := test.ocClient.AdminConfigClient().ConfigV1().Infrastructures().Get(context.Background(), "cluster", metav1.GetOptions{}) |
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.
Would it be possible to have some kind of global somewhere so we can store the controlplanetopology instead of fetching it in every test that needs to switch behavior based on its value?
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 can certainly look into that
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 hopefully have something sufficient to do that now
3b1030e
to
c44b654
Compare
test/extended/util/framework.go
Outdated
|
||
// GetControlPlaneTopology retrieves the cluster infrastructure TopologyMode | ||
func GetControlPlaneTopology(ocClient *CLI) (*configv1.TopologyMode, error) { | ||
if ControlPlaneTopology == nil { |
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 this needs to be threadsafe/protected by a sync.Mutex as tests could end up calling this in parallel
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.
Added a mutex lock to the function
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.
the mutex already needs to be used for reading ( if ControlPlaneTopology == nil
) as reading/writing to a variable in parallel is a datarace.
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.
Will the additional locking be acceptable, if we always perform it when this function is called, compared with the additional check after receiving the lock, prior to attempting to set the value?
I considered using the builtin once
, but was not confident that that would work properly if an error was raised while attempting to get the Infrastructure.Status.ControlPlaneTopology
.
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.
If we just lock in the very beginning of the function prior to reading we are good. An additional check prior to setting the value would only be needed if we used a RWLock, but I don't think we need that.
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.
okay, I'll make that change, thanks!
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.
updated
e7167da
to
5671723
Compare
/approve |
Refactor code related to skipping tests on IBM Cloud to skip based on External ControlPlaneTopology, or Managed offering. IBM Cloud will be offering an OCP, unmanaged, cluster that should not skip such tests.
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.
thanks for your work!
@cjschaef: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
/lgtm |
/bugzilla refresh |
@alvaroaleman: This pull request references Bugzilla bug 2015624, which is invalid:
Comment 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. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: alvaroaleman, cjschaef, ironcladlou 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 |
/bugzilla refresh |
@alvaroaleman: This pull request references Bugzilla bug 2015624, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker. 3 validation(s) were run on this bug
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. |
/retest-required Please review the full test history for this PR and help us cut down flakes. |
@cjschaef: All pull requests linked via external trackers have merged: Bugzilla bug 2015624 has been moved to the MODIFIED state. 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. |
Refactor code related to skipping tests on IBM Cloud to skip based
on External ControlPlaneTopology, or Managed offering. IBM Cloud
will be offering an OCP, unmanaged, cluster that should not skip
such tests.