-
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
🌱 Add unit test coverage for machineDeployments. reconcileOldMachineSets #4498
🌱 Add unit test coverage for machineDeployments. reconcileOldMachineSets #4498
Conversation
/hold |
f35ea8f
to
ad3323e
Compare
// Safely scale down all old machine sets with unhealthy replicas. Replica set will sort the machines in the order | ||
// such that not-ready < ready, unscheduled < scheduled, and pending < running. This ensures that unhealthy replicas will | ||
// been deleted first and won't increase unavailability. | ||
// Scale down all old MachineSets with any unhealthy replicas. MachineSet will honour Spec.DeletePolicy |
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 comment seemed very old left over from pod/replicaSet/Deployment. Please review my update to consolidate with reality.
ad3323e
to
7040d62
Compare
/hold cancel |
known flake? /test pull-cluster-api-test-main |
@enxebre I think yes. Maybe this link helps for identifying flakes more easily: https://testgrid.k8s.io/sig-cluster-lifecycle-cluster-api#capi-test-main&exclude-non-failed-tests=&sort-by-failures=&width=12&group-by-hierarchy-pattern=(sigs.k8s.io%2Fcluster-api%2F%5B%5E%5C.%5D*.%7CTest%5B%5E%5C%2F%5D*%2F%7C.*) That's the best testgrid filter I could come up with. But those flakes are so rare that you can just run the test twice and if the test fails both times it's probably caused by a change in the code. |
5843b7c
to
8941326
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.
one nit, not sure how we handle this usually, apart from that lgtm
|
||
err := r.reconcileOldMachineSets(ctx, allMachineSets, tc.oldMachineSets, tc.newMachineSet, tc.machineDeployment) | ||
if tc.error != nil { | ||
g.Expect(err.Error()).To(BeEquivalentTo(tc.error.Error())) |
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 tc.error != nil and err == nil this will lead to a nil pointer, probably better if we guard against that. (same in TestReconcileNewMachineSet above)
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.
Fixed. Thanks!
50565c3
to
be93472
Compare
be93472
to
a31cb9b
Compare
/lgtm |
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri 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 |
What this PR does / why we need it:
Increase unit test coverage fo machineDeployments rolling upgrades. TestReconcileOldMachineSets.
Follow up PR for #4495 related to #4457
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 #