-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🌱 Fix flaky test in extensionconfig_controller_test.go #12386
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
base: main
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/test all |
/area ci |
/retitle 🌱 Fix flaky test in extensionconfig_controller_test.go |
e449861
to
3b952de
Compare
I think this attempts to fix #12311. |
Yes, I couldn't find time to resolve the CI error. |
c9439f8
to
d9e44b7
Compare
Still occurring a CI error, but I'm not sure of the cause.
|
Did you already rebase on top of main? CI is running based on latest main + the PR |
Yes, already rebase with fresh main... |
Oh, I'm really sorry... I had mistakenly set up the upstream configuration on my machine (just for this repo), and origin/main wasn't fetching correctly for a while. I've rebased on the latest main now. All CIs seems to be working well :) |
What this PR does
Fixed a flaky test -
TestExtensionReconciler_Reconcile
by adding proper sync to wait for both Paused and Discovery conditions to be set before performing assertionswhy we need it
The
paused.EnsurePausedCondition()
function triggers multiple reconciliation cycles:PausedV1Beta2Condition
and returnsrequeue=true
(early return)ExtensionConfigDiscoveredV1Beta2Condition
The test assertion
g.Expect(v1beta2Conditions).To(HaveLen(2))
was executed immediately after the second reconcile call, but before the patch containing the Discovery condition was fully applied to the API server (race condition I think).So we need to
Eventually
block to resolve this race conditionWhich issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #12311