Skip to content

CMP-3846: Add test for successful compliance operator deletion (54055)#1007

Open
taimurhafeez wants to merge 3 commits intoComplianceAsCode:masterfrom
taimurhafeez:CMP-3846
Open

CMP-3846: Add test for successful compliance operator deletion (54055)#1007
taimurhafeez wants to merge 3 commits intoComplianceAsCode:masterfrom
taimurhafeez:CMP-3846

Conversation

@taimurhafeez
Copy link
Collaborator

@taimurhafeez taimurhafeez commented Nov 27, 2025

Add verification that the compliance operator namespace deletion completes successfully during test teardown, ensuring the operator can be deleted cleanly without resources getting stuck in a terminating state.

It has been integrated into tear-down phase after any test. For instance, it can be checked by running any test such as
make e2e-parallel E2E_GO_TEST_FLAGS="-v -run TestScanProducesRemediations"

expected output on OCP 4.21:

=== RUN   TestScanProducesRemediations
=== PAUSE TestScanProducesRemediations
=== CONT  TestScanProducesRemediations
2026/03/02 14:54:16 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: RUNNING
2026/03/02 14:54:21 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: RUNNING
2026/03/02 14:54:26 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: RUNNING
2026/03/02 14:54:31 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: RUNNING
2026/03/02 14:54:36 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: RUNNING
2026/03/02 14:54:41 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: RUNNING
2026/03/02 14:54:46 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: AGGREGATING
2026/03/02 14:54:51 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: AGGREGATING
2026/03/02 14:54:56 waiting until suite test-scan-produces-remediations reaches target status 'DONE'. Current status: AGGREGATING
2026/03/02 14:55:06 ComplianceScan ready (DONE)
2026/03/02 14:55:06 All scans in ComplianceSuite have finished (test-scan-produces-remediations)
osdk-e2e-d84bfbe0-a21b-4345-bc90-bf9af847d9d0 map[compliance.openshift.io/suite:test-scan-produces-remediations]
--- PASS: TestScanProducesRemediations (55.77s)
PASS

@openshift-ci-robot
Copy link
Collaborator

@taimurhafeez: This pull request references CMP-3846 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.21.0" version, but no target version was set.

Details

In response to this:

It has been integrated into tear-down phase after any test. For instance, it can be checked by running any test such as
make e2e-parallel E2E_GO_TEST_FLAGS="-v -run TestScanProducesRemediations"

expected output:

2025/11/27 13:06:34 cleaning up namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898
2025/11/27 13:06:34 ========== OCP-54055: Verifying namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 deletion completes successfully ==========
2025/11/27 13:06:40 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:06:45 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:06:50 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:06:55 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:07:00 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:07:05 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:07:10 ========== OCP-54055: Namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 successfully deleted - verification PASSED ==========
ok  	github.com/ComplianceAsCode/compliance-operator/tests/e2e/parallel	301.574s

Important to note: Changes proposed in PR-960 need to be merged before testing it.

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
Copy link

openshift-ci bot commented Nov 27, 2025

Hi @taimurhafeez. Thanks for your PR.

I'm waiting for a github.com member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

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.

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

Looking good, and this is a perfect usecase for the tearDown phase.

Only minor comments on the test ID and the commented out log statement.

@xiaojiey
Copy link
Collaborator

xiaojiey commented Dec 4, 2025

/retest

1 similar comment
@xiaojiey
Copy link
Collaborator

xiaojiey commented Dec 5, 2025

/retest

@xiaojiey
Copy link
Collaborator

xiaojiey commented Dec 5, 2025

This error(seems unrelated to the change) is strange. Rerun the job to see whether it reproduce again.

2025/12/04 09:41:20 cleaning up Profile Bundles
removing label node-role.kubernetes.io/e2e from node ip-10-0-1-4.us-west-1.compute.internal
2025/12/04 09:41:21 failed to remove label node-role.kubernetes.io/e2e from node ip-10-0-1-4.us-west-1.compute.internal: Operation cannot be fulfilled on nodes "ip-10-0-1-4.us-west-1.compute.internal": the object has been modified; please apply your changes to the latest version and try again
FAIL	github.com/ComplianceAsCode/compliance-operator/tests/e2e/parallel	872.076s
FAIL

@taimurhafeez
Copy link
Collaborator Author

taimurhafeez commented Dec 8, 2025

This error(seems unrelated to the change) is strange. Rerun the job to see whether it reproduce again.

2025/12/04 09:41:20 cleaning up Profile Bundles
removing label node-role.kubernetes.io/e2e from node ip-10-0-1-4.us-west-1.compute.internal
2025/12/04 09:41:21 failed to remove label node-role.kubernetes.io/e2e from node ip-10-0-1-4.us-west-1.compute.internal: Operation cannot be fulfilled on nodes "ip-10-0-1-4.us-west-1.compute.internal": the object has been modified; please apply your changes to the latest version and try again
FAIL	github.com/ComplianceAsCode/compliance-operator/tests/e2e/parallel	872.076s
FAIL

@xiaojiey I tested it again and did not encounter the error. I ran on 4.20 aws.

2025/12/08 15:23:21 cleaning up Profile Bundles
removing label node-role.kubernetes.io/e2e from node ip-10-0-112-163.ec2.internal
waiting for nodes to reach rendered-e2e-e6d454726602568550684d1cd5f78388
Node ip-10-0-112-163.ec2.internal has config rendered-e2e-e6d454726602568550684d1cd5f78388, desired config rendered-e2e-e6d454726602568550684d1cd5f78388 state Done2025/12/08 15:23:25 node ip-10-0-112-163.ec2.internal was updated
2025/12/08 15:23:25 all nodes in Machine Config Pool e2e were updated successfully
2025/12/08 15:23:25 cleaning up Machine Config Pool e2e

@rhmdnd
Copy link
Collaborator

rhmdnd commented Dec 8, 2025

I think this looks good and the failure seems unrelated.

I'm chasing down the TestScheduledSuite failure in #1024

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

/lgtm

@taimurhafeez
Copy link
Collaborator Author

/retest

@rhmdnd
Copy link
Collaborator

rhmdnd commented Feb 27, 2026

Adding doc approval since this is test-only.

@rhmdnd
Copy link
Collaborator

rhmdnd commented Feb 27, 2026

I wonder if this needs to be rebased to get EC testing to pass?

@openshift-ci-robot
Copy link
Collaborator

@taimurhafeez: This pull request references CMP-3846 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

It has been integrated into tear-down phase after any test. For instance, it can be checked by running any test such as
make e2e-parallel E2E_GO_TEST_FLAGS="-v -run TestScanProducesRemediations"

expected output:

2025/11/27 13:06:34 cleaning up namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898
2025/11/27 13:06:34 ========== OCP-54055: Verifying namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 deletion completes successfully ==========
2025/11/27 13:06:40 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:06:45 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:06:50 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:06:55 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:07:00 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:07:05 Waiting for namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 to be fully deleted...
2025/11/27 13:07:10 ========== OCP-54055: Namespace osdk-e2e-37fc2766-e722-4768-98e7-87ee880b6898 successfully deleted - verification PASSED ==========
ok  	github.com/ComplianceAsCode/compliance-operator/tests/e2e/parallel	301.574s

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot removed the lgtm label Mar 2, 2026
@github-actions
Copy link

github-actions bot commented Mar 2, 2026

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1007-f58895b21f430e45464505438275494c7d5a4567

Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm label Mar 2, 2026
Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

Oops - wrong button. Approved.

@rhmdnd rhmdnd added this to the 1.9.0 milestone Mar 3, 2026
Copy link
Collaborator

@rhmdnd rhmdnd left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci
Copy link

openshift-ci bot commented Mar 3, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhmdnd, taimurhafeez

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [rhmdnd,taimurhafeez]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@rhmdnd
Copy link
Collaborator

rhmdnd commented Mar 3, 2026

Serial failure is unrelated and we're attempting to fix in #1100. Rosa failure is unrelated.

@openshift-ci
Copy link

openshift-ci bot commented Mar 3, 2026

New changes are detected. LGTM label has been removed.

@github-actions
Copy link

github-actions bot commented Mar 3, 2026

🤖 To deploy this PR, run the following command:

make catalog-deploy CATALOG_IMG=ghcr.io/complianceascode/compliance-operator-catalog:1007-f3a9c816bfcb4db75bb857df43b0c25722cbddc8

@openshift-ci
Copy link

openshift-ci bot commented Mar 3, 2026

@taimurhafeez: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-serial f58895b link true /test e2e-aws-serial
ci/prow/e2e-rosa f3a9c81 link true /test e2e-rosa

Full PR test history. Your PR dashboard.

Details

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. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants