Skip to content

fix: local E2E test should not delete CRD#3324

Merged
csviri merged 2 commits intooperator-framework:mainfrom
csviri:fix-tomcat-test
Apr 30, 2026
Merged

fix: local E2E test should not delete CRD#3324
csviri merged 2 commits intooperator-framework:mainfrom
csviri:fix-tomcat-test

Conversation

@csviri
Copy link
Copy Markdown
Collaborator

@csviri csviri commented Apr 29, 2026

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

Copilot AI review requested due to automatic review settings April 29, 2026 07:07
@openshift-ci openshift-ci Bot requested review from metacosm and xstefank April 29, 2026 07:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) on LocallyRunOperatorExtension builders.
  • 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.

Copy link
Copy Markdown
Collaborator

@xstefank xstefank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should then wait for the delete to finish?

@csviri
Copy link
Copy Markdown
Collaborator Author

csviri commented Apr 29, 2026

Maybe we should then wait for the delete to finish?

Let's experiment with that in a followup PR, mainly I want to have them stable for the other PRs. WDYT?

csviri added 2 commits April 30, 2026 13:35
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>
Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
@csviri csviri merged commit e31bda1 into operator-framework:main Apr 30, 2026
45 of 47 checks passed
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants