-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
wip: Reduce flake for integration test TestStartStop #6999
Conversation
/ok-to-test |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh 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 |
Error: running mkcmp: exit status 1 |
Error: running mkcmp: exit status 1 |
All Times minikube: [ 63.898231 67.423725 63.331392] Average minikube: 64.884449 Averages Time Per Log
|
Codecov Report
@@ Coverage Diff @@
## master #6999 +/- ##
=========================================
Coverage ? 37.23%
=========================================
Files ? 144
Lines ? 9079
Branches ? 0
=========================================
Hits ? 3381
Misses ? 5272
Partials ? 426 |
All Times minikube: [ 66.552134 64.958802 65.883644] Average minikube: 65.798193 Averages Time Per Log
|
@@ -106,7 +106,7 @@ func validateMountCmd(ctx context.Context, t *testing.T, profile string) { | |||
} | |||
|
|||
start := time.Now() | |||
if err := retry.Expo(checkMount, time.Second, 15*time.Second); err != nil { | |||
if err := retry.Expo(checkMount, time.Second, Seconds(15)); err != 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.
Seconds is not a good name for this function.
How about "ApproximateSeconds" or "SecondsWithMultiplier"?
// to avoid https://github.com/kubernetes/minikube/issues/6997 | ||
// adding this logic to minikube start is not necessary but useful for rare test flakes | ||
saReady := func() error { // check if default service account is created. | ||
if _, err := Run(t, exec.CommandContext(ctx, "kubectl", "--context", profile, "get", "serviceaccount", "default")); err != 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.
This seems to be covering up an actual flaw that users can face. Shouldn't the start command wait for this?
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 thought about this, this rarely happens but it eats up 13 seconds of waiting on my machine. I have a feeling that would not be helpful
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.
As I understand it, this integration test is surfacing a bug: minikube start + kubectl is currently racy. As it is successfully capturing a rare race condition (yay!), we should either fix it, or leave it present, not paper over it.
I believe the right way to go about this is to add a --wait-for-serviceaccount
flag to minikube start, and set it to false initially, but override it in these tests that are affected. That way other users who prefer reliability over latency can benefit: integration tests, IDE's, etc. This way we can better measure how to optimize for serviceaccount start latency.
I would argue that defaulting this flag to 'true' would be more in the spirit of minikube (reliability > latency) , but I do understand the trade-off here, and am comfortable leaving it as false for the time being.
Thoughts?
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.
@tstromberg
I agree with you, lets not merge this PR so it bugs us in integeration test,
and we fix minikube, here are my thoughts, let keep the discussion in this issue so others can participate, #7011 (comment)
closing in favor of #7209 |
@medyagh: PR needs rebase. 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. |
in first verison of this PR, I tried adding checking for service account being ready to minikube wait, but that adds 13seconds of waiting, for almost very small amount of use cases
Fixes #6997