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
Cleanup non-namespaced objects in e2e test during interrupts #96023
Cleanup non-namespaced objects in e2e test during interrupts #96023
Conversation
@chrishenzie: This issue is currently awaiting triage. If a SIG or subproject determines this is a relevant issue, they will accept it by applying the The 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. |
Hi @chrishenzie. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the 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. |
/ok-to-test Edit: nm I spoke too soon, this is adding it just to the testsuite |
|
||
l.pods = append(l.pods, pod) | ||
} | ||
f.AddAfterEach("cleanup", func(f *framework.Framework, failed bool) { |
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.
Do you know what the difference is between AddAfterEach
and ginkgo.AfterEach
?
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.
AddAfterEach
appends a function to execute as part of the framework's AfterEach
, which is registered with ginkgo via ginkgo.AfterEach
:
kubernetes/test/e2e/framework/framework.go
Line 175 in 7bf9b0a
ginkgo.AfterEach(f.AfterEach) |
I expected I could replace this with a call to ginkgo.AfterEach
and see it work, but when I tested it, it didn't run.
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.
That's unexpected. Most of our other tests do not use AddAfterEach
. It may be worth following up with sig-testing on this.
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chrishenzie, msau42 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 |
/lgtm |
/sig storage
What type of PR is this?
/kind bug
What this PR does / why we need it:
This PR fixes an issue where if this e2e test is interrupted, only the namespace gets cleaned up. Non-namespaced objects like StorageClasses are not cleaned up.
Which issue(s) this PR fixes:
Fixes #96022
Special notes for your reviewer:
The test framework has an
AddAfterEach()
block that allows us to handle this test cleanup logic.Since we are handling the test cleanup in an
AfterEach()
step, I figured it was intuitive to handle the equivalent test setup in aBeforeEach()
step. I split this into two parts. One that asserts things before the test framework is created (which creates a namespace), and one that sets up everything else after. TheseBeforeEach()
blocks run sequentially before everyIt()
block.Does this PR introduce a user-facing change?:
@msau42