-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Reduce total duration of clusterctl tests by switching from wait.Poll to wait.PollImmediate(...) #331
Reduce total duration of clusterctl tests by switching from wait.Poll to wait.PollImmediate(...) #331
Conversation
…(...) to wait.PollImmediate(...)
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: spew 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 |
/assign @jessicaochen @karan |
/lgtm |
@dims: changing LGTM is restricted to assignees, and only kubernetes-sigs/cluster-api repo collaborators may be assigned issues. 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. |
/hold |
Question - how does it affect the actual runtime? The docs see to be not accurate here https://github.com/kubernetes/apimachinery/blob/master/pkg/util/wait/wait.go#L230 |
I had would have thought Poll would check a condition first before going into the wait. Is there any reason not to have wait.PollImmediate be our default Poll? |
@karan for the real runtime i think the effect will be negligable because often times the first poll won't be successful anyway (i.e. more time needs to be waited until the condition becomes true). From the docs for wait.Poll:
From the docs for wait.PollImmediate
I am not seeing any inaccuracy. However, there does seem to be a mistake in that the "Immediate" is missing after Poll so maybe that's where the confusion comes from. |
@jessicaochen Most likely our default Poll should be PollImmediate, however, I limited the scope of this change to only the code I was testing directly. |
Opened a PR for fixing the wait.PollImmediate docs here: kubernetes/kubernetes#65026 |
Sure, could you create an issue to track making PollImmediate our repo default so we have consistency in the future? |
Created an issue for that: #336 |
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.
lgtm (leaving backslash for seconary lgtm-er)
@karan could please take another look. |
/lgtm |
/hold cancel |
What this PR does / why we need it:
This PR improves the runtime of the clusterctl unit tests by polling immediately for changes instead of waiting first. On my Mac the runtime is reduced from ~48 seconds to around 10 seconds. A runtime comparison of the clusterctl folder's for
go test ./...
BEFORE:
AFTER
Release note:
@kubernetes/kube-deploy-reviewers