fix: local E2E test should not delete CRD#3324
Merged
csviri merged 2 commits intooperator-framework:mainfrom Apr 30, 2026
Merged
fix: local E2E test should not delete CRD#3324csviri merged 2 commits intooperator-framework:mainfrom
csviri merged 2 commits intooperator-framework:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates sample-operator E2E tests to avoid deleting CRDs during local runs, preventing a race where CRDs can be marked for deletion and later removed while other cluster-based tests are executing.
Changes:
- Disable CRD deletion for locally-run E2E tests by setting
withDeleteCRDs(false)onLocallyRunOperatorExtensionbuilders. - Apply the configuration across multiple sample operators (webpage, tomcat, mysql-schema, metrics-processing).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sample-operators/webpage/src/test/java/io/javaoperatorsdk/operator/sample/WebPageOperatorE2E.java | Disables CRD deletion for local webpage E2E runs. |
| sample-operators/tomcat-operator/src/test/java/io/javaoperatorsdk/operator/sample/TomcatOperatorE2E.java | Disables CRD deletion for local tomcat E2E runs. |
| sample-operators/mysql-schema/src/test/java/io/javaoperatorsdk/operator/sample/MySQLSchemaOperatorE2E.java | Disables CRD deletion for local mysql-schema E2E runs. |
| sample-operators/metrics-processing/src/test/java/io/javaoperatorsdk/operator/sample/metrics/MetricsHandlingE2E.java | Disables CRD deletion for local metrics-processing E2E runs. |
xstefank
reviewed
Apr 29, 2026
Collaborator
xstefank
left a comment
There was a problem hiding this comment.
Maybe we should then wait for the delete to finish?
Collaborator
Author
Let's experiment with that in a followup PR, mainly I want to have them stable for the other PRs. WDYT? |
That causes a race condition, where it marks the CRD to be deleted. But since we don't wait for cleanup of the namespace in E2E eventually the namespace is deleted by garbage collector and then the CRD is deleted. Unfortunatelly this can happen when the cluster test is already running. Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
metacosm
approved these changes
Apr 30, 2026
csviri
added a commit
that referenced
this pull request
Apr 30, 2026
* fix: local E2E test should not delete CRD That causes a race condition, where it marks the CRD to be deleted. But since we don't wait for cleanup of the namespace in E2E eventually the namespace is deleted by garbage collector and then the CRD is deleted. Unfortunately this can happen when the cluster test is already running. Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
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.
That causes a race condition, where it marks the CRD to be deleted.
But since we don't wait for cleanup of the namespace in E2E eventually the
namespace is deleted by garbage collector and then the CRD is deleted.
Unfortunatelly this can happen when the cluster test is already running.
Signed-off-by: Attila Mészáros a_meszaros@apple.com