e2e tests: use ginkgo.DeferCleanup for consistent resource cleanup#1705
Open
ErikJiang wants to merge 1 commit into
Open
e2e tests: use ginkgo.DeferCleanup for consistent resource cleanup#1705ErikJiang wants to merge 1 commit into
ErikJiang wants to merge 1 commit into
Conversation
Collaborator
|
sorry, can you pls resolve the conflicts |
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
ErikJiang
force-pushed
the
use_ginkgo_defercleanup
branch
from
June 29, 2026 02:20
895c168 to
309cdd9
Compare
Contributor
Author
|
Done. Conflicts resolved. PTAL. @ahg-g |
Contributor
|
@ErikJiang I am working on making the E2E tests run in parallel. To simplify the code, the tests are wrapped with a wrapper that does per group of tests (basically under a ginkgo.When block). The wrapper uses ginkgo.BeforeAll and ginkgo.AfterAll calls to perform standard per test group (i.e. namespace) setup and teardown. This doesn't work well with using ginkgo.DeferedCleanup. |
Collaborator
|
@shmuelk - is this PR (or some other form of it) needed after the move to parallel e2e? |
Contributor
|
As I commented above the use of DeferredCleanup has to be used very carefully with the new parallel tests. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Use ginkgo.DeferCleanup consistently across all e2e tests instead of manually calling testutils.DeleteObjects at the end of each test.
This ensures resources are cleaned up even when a test fails before reaching the cleanup code, preventing resource leaks and test pollution.
Which issue(s) this PR fixes:
Fixes #
Release note (write
NONEif no user-facing change):