test: don't delete namespaces in unit tests#854
Open
mandre wants to merge 1 commit into
Open
Conversation
Namespace deletion is asynchronous — a deleted namespace enters a Terminating state before being fully removed. If the next test's GenerateName produces a suffix that collides with a still-Terminating namespace, the API server returns a hard error rather than retrying with a new name. Since all unit tests run against an envtest API server that is torn down in AfterSuite, explicit namespace deletion is unnecessary. Remove the DeferCleanup blocks that delete namespaces to eliminate the flake. Closes k-orc#850
Contributor
|
Nice one LGTM, noticed the same namespace deletion is included in the openstack-resource-controller/internal/controllers/image/upload_test.go Lines 200 to 204 in ef6119d |
Member
|
I think this partially solves the problem. When one test produces a suffix that clashes with an existing namespace, regardless it's being deleted or not, don't the apiserver return an error about trying to create an existing namespace? |
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.
Namespace deletion is asynchronous — a deleted namespace enters a Terminating state before being fully removed. If the next test's GenerateName produces a suffix that collides with a still-Terminating namespace, the API server returns a hard error rather than retrying with a new name.
Since all unit tests run against an envtest API server that is torn down in AfterSuite, explicit namespace deletion is unnecessary. Remove the DeferCleanup blocks that delete namespaces to eliminate the flake.
Closes #850