-
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
🐛 Fix flaky TestServerSideApplyWithDefaulting test #8166
🐛 Fix flaky TestServerSideApplyWithDefaulting test #8166
Conversation
/assign @killianmuldoon @fabriziopandini |
// Ensure patchKCT was defaulted. | ||
g.Expect(env.Get(ctx, client.ObjectKeyFromObject(kct), patchKCT)) | ||
g.Expect(patchKCT.Spec.Template.Spec.Users).To(Equal([]bootstrapv1.User{{Name: "default-user"}})) | ||
}, 5*time.Second).Should(Succeed()) |
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.
Q on this, but not really for this PR. Wasn't there an issue recently with incorrectly specified timeouts / polling frequencies with Gomega's eventually?
I can't remember exactly what the issue was though.
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.
Nice catch, thank you.
But turns out my previous take was wrong.
gomega is doing the following
if len(intervals) > 0 {
timeoutInterval, err = toDuration(intervals[0])
if err != nil {
g.Fail(err.Error(), offset+baseOffset)
}
}
if len(intervals) > 1 {
pollingInterval, err = toDuration(intervals[1])
if err != nil {
g.Fail(err.Error(), offset+baseOffset)
}
}
Which means if you only set one interval you only set the timeoutInterval and not the pollingInterval.
I thought this means it doesn't actually retry. I justed tested it and it turns out it does retry. Going through some gomega internals reveals that gomega is using a default poll interval of 100ms (100ms for eventually, 10ms for consistently)
So we should be good
8f05abc
to
bcbe5c8
Compare
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
/approve
LGTM label has been added. Git tree hash: 4aa47c606da1eb268bb2aa8223d10ee8c6afbefc
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: killianmuldoon 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 |
Signed-off-by: Stefan Büringer [email protected]
bcbe5c8
to
fb9dd92
Compare
Signed-off-by: Stefan Büringer [email protected]
What this PR does / why we need it:
I think this should fix it.
xref: https://prow.k8s.io/view/gs/kubernetes-jenkins/logs/periodic-cluster-api-test-main/1628652755163811840
Also saw the same failure on a few PRs.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #