Skip to content
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

🌱 test: Ensure finalizers are re-reconciled #2626

Merged

Conversation

adityabhatia
Copy link
Contributor

@adityabhatia adityabhatia commented Jan 17, 2024

What this PR does / why we need it:
This PR introduces finalizer resiliency checks - covering both initial presence and upon deletion cases using the CAPI e2e test framework.

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 # #2357

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 17, 2024
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 17, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @adityabhatia. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 17, 2024
@adityabhatia adityabhatia force-pushed the ensureFinalisersResiliancy branch 2 times, most recently from 1c696df to 2f118bb Compare January 18, 2024 17:38
@adityabhatia adityabhatia changed the title [WIP] 🌱 test: Ensure finalizers are re-reconciled 🌱 test: Ensure finalizers are re-reconciled Jan 18, 2024
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 18, 2024
@@ -177,7 +177,7 @@ var (

// cleanupVSphereObjects deletes the Secret, VSphereClusterIdentity, and VSphereDeploymentZone created for this test.
// The VSphereFailureDomain, and the Secret for the VSphereClusterIdentity should be deleted as a result of the above.
func cleanupVSphereObjects(ctx context.Context, bootstrapClusterProxy framework.ClusterProxy) bool {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed the boolean return value since linter was complaining, also I do not see any use.

Comment on lines 53 to 59
// This check ensures that finalizers are resilient - i.e. correctly re-reconciled, when removed.
framework.ValidateFinalizersResilience(ctx, proxy, namespace, clusterName,
framework.CoreFinalizersAssertion,
framework.KubeadmControlPlaneFinalizersAssertion,
framework.ExpFinalizersAssertion,
VSphereFinalizers,
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the ownerreference test already has what we need (from object perspective).

Could we combine these two tests maybe to combine ownerreferences and finalizers in one test?
If I got it right its only about having all the objects and running framework.ValidateFinalizersResilience as PostMachinesProvisioned.
This would reduce the time needed for CI because bringing up cluster takes time and costs resources :-)

Or do you see points why we should not combine them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes combining these tests will surely make it more efficient, should also work (looks good locally).

I have purposely made a second commit to see the notable differences, before and after test combination and also renamed the flavor ownerreferences -> ownerrefs-finalizers which IMO reflects the purpose of the combined test. 42a1cff

Once these changes are reviewed I will squash my commits.

@zhanggbj
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 19, 2024
Copy link

codecov bot commented Jan 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (a938dbd) 64.84% compared to head (4f1352f) 64.56%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2626      +/-   ##
==========================================
- Coverage   64.84%   64.56%   -0.28%     
==========================================
  Files         118      118              
  Lines        8580     8580              
==========================================
- Hits         5564     5540      -24     
- Misses       2588     2605      +17     
- Partials      428      435       +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -0,0 +1,8 @@
---
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these can get removed right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes this will also go away, it was just kept for reference. If you think the combined tests should be ok, I can push a squashed commit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, please drop them 👍

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(and feel free to squash)

@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jan 19, 2024
@chrischdi
Copy link
Member

/test help

@k8s-ci-robot
Copy link
Contributor

@chrischdi: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test pull-cluster-api-provider-vsphere-conformance-ci-latest-main
  • /test pull-cluster-api-provider-vsphere-conformance-main
  • /test pull-cluster-api-provider-vsphere-e2e-full-main
  • /test pull-cluster-api-provider-vsphere-e2e-main
  • /test pull-cluster-api-provider-vsphere-test-integration-main
  • /test pull-cluster-api-provider-vsphere-test-main
  • /test pull-cluster-api-provider-vsphere-verify-main

The following commands are available to trigger optional jobs:

  • /test pull-cluster-api-provider-vsphere-apidiff-main

Use /test all to run the following jobs that were automatically triggered:

  • pull-cluster-api-provider-vsphere-apidiff-main
  • pull-cluster-api-provider-vsphere-e2e-main
  • pull-cluster-api-provider-vsphere-test-integration-main
  • pull-cluster-api-provider-vsphere-test-main
  • pull-cluster-api-provider-vsphere-verify-main

In response to this:

/test help

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.

@chrischdi
Copy link
Member

/test pull-cluster-api-provider-vsphere-e2e-full-main

@sbueringer
Copy link
Member

/lgtm

/test pull-cluster-api-provider-vsphere-e2e-full-main

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 22, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: 1dfa4428807feef34e3fa73b51a57d22cec8ec70

@sbueringer
Copy link
Member

/assign @chrischdi

@sbueringer
Copy link
Member

@adityabhatia Can you please rebase?

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 25, 2024
@sbueringer
Copy link
Member

Thx!
/lgtm

/assign @chrischdi

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 26, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: e1ba044833255598a86fcca143dc347523a4ca17

@chrischdi
Copy link
Member

/approve

1 similar comment
@sbueringer
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chrischdi, sbueringer

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:
  • OWNERS [chrischdi,sbueringer]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 26, 2024
@k8s-ci-robot k8s-ci-robot merged commit 54a227f into kubernetes-sigs:main Jan 26, 2024
18 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.9 milestone Jan 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants