-
Notifications
You must be signed in to change notification settings - Fork 41k
Fix volume limit e2e test cleanup #132674
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 volume limit e2e test cleanup #132674
Conversation
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-sigs/prow repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jsafrane 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 |
/retest |
@@ -169,7 +170,7 @@ func (t *volumeLimitsTestSuite) DefineTests(driver storageframework.TestDriver, | |||
|
|||
l.resource = storageframework.CreateVolumeResource(ctx, driver, l.config, pattern, testVolumeSizeRange) | |||
ginkgo.DeferCleanup(l.resource.CleanupResource) | |||
ginkgo.DeferCleanup(cleanupTest, l.cs, l.ns.Name, l.podNames, l.pvcNames, l.pvNames, testSlowMultiplier*f.Timeouts.PVDelete) | |||
ginkgo.DeferCleanup(cleanupTest, &l, testSlowMultiplier*f.Timeouts.PVDelete) |
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.
We have pretty well established pattern of each test suite defining a local cleanup
function -
cleanup := func(ctx context.Context) { |
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.
Moved to closure, same as volume_modify.go.
Pass the local test state to cleanupTest() as a pointer. It is mostly empty at the point of calling `DeferCleanup(cleanupTest)`, so using `ginkgo.DeferCleanup(cleanupTest, ..., l.podNames, ...)` will pass empty podNames to the cleanup. And now that the cleanup actually does something, fix the error handling in it.
54403ef
to
ebea328
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.
The issue that this PRs fixes manifested when another test tried to drain the node. I can confirm that I no longer can reproduce it after applying this patch.
/lgtm
LGTM label has been added. Git tree hash: 9381842821b5787fb082b5afd337f81f29e664ec
|
/retest |
/test pull-kubernetes-unit |
/test pull-kubernetes-unit |
/test pull-kubernetes-e2e-gce |
/test pull-kubernetes-e2e-gce |
Pass the local test state to
cleanupTest()
as a pointer. It is mostly empty at the point of callingDeferCleanup(cleanupTest, ...)
, so usingginkgo.DeferCleanup(cleanupTest, ..., l.podNames, ...)
just passes emptypodNames
to the cleanup and the test pods are not deleted.l.podNames
gets populated later and the cleanup must use the updated one.And now that the cleanup actually does something, fix the error handling in it.
As result, the test deletes all test pods while csi-driver-hostpath is still installed and the pods can be actually deleted.
What type of PR is this?
/kind bug
/kind failing-test
Fixes: #132673
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: