compliance-operator icon indicating copy to clipboard operation
compliance-operator copied to clipboard

Expose test clean up issues in compliance scan controller

Open rhmdnd opened this issue 2 years ago • 4 comments

While in the process of updating the controller-runtime from 0.15.0 to 0.16.2, I noticed some strange failures in the unit tests. Specifically, it didn't look like some of the resources were getting cleaned up properly, even though we attempt to create them before each spec.

rhmdnd avatar Sep 19 '23 16:09 rhmdnd

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: rhmdnd

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

The pull request process is described here

Needs approval from an approver in each of these files:

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

openshift-ci[bot] avatar Sep 19 '23 16:09 openshift-ci[bot]

Recreated the issue in CI:

 • Failure in Spec Setup (BeforeEach) [1.011 seconds]
Testing compliancescan controller phases
/go/src/github.com/openshift/compliance-operator/pkg/controller/compliancescan/compliancescan_controller_test.go:78
  On the DONE phase
  /go/src/github.com/openshift/compliance-operator/pkg/controller/compliancescan/compliancescan_controller_test.go:431
    with delete flag off
    /go/src/github.com/openshift/compliance-operator/pkg/controller/compliancescan/compliancescan_controller_test.go:432
      Should return success & preserve resources [BeforeEach]
      /go/src/github.com/openshift/compliance-operator/pkg/controller/compliancescan/compliancescan_controller_test.go:451
      Unexpected error:
              
          <*errors.StatusError | 0xc00028eaa0>: 
          secrets "result-server-cert-test" already exists
          {
              ErrStatus: {
                  TypeMeta: {Kind: "", APIVersion: ""},
                  ListMeta: {
                      SelfLink: "",
                      ResourceVersion: "",
                      Continue: "",
                      RemainingItemCount: nil,
                  },
                  Status: "Failure",
                  Message: "secrets \"result-server-cert-test\" already exists",
                  Reason: "AlreadyExists",
                  Details: {
                      Name: "result-server-cert-test",
                      Group: "",
                      Kind: "secrets",
                      UID: "",
                      Causes: nil,
                      RetryAfterSeconds: 0,
                  },
                  Code: 409,
              },
          }
      occurred
      /go/src/github.com/openshift/compliance-operator/pkg/controller/compliancescan/compliancescan_controller_test.go:439 

rhmdnd avatar Sep 20 '23 13:09 rhmdnd

PR needs rebase.

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/test-infra repository.

openshift-merge-robot avatar Nov 05 '23 22:11 openshift-merge-robot

@rhmdnd: 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/unit ae1709deb3eb699a620cd49cf8bfca36cf942e01 link true /test unit
ci/prow/images ae1709deb3eb699a620cd49cf8bfca36cf942e01 link true /test images
ci/prow/e2e-rosa ae1709deb3eb699a620cd49cf8bfca36cf942e01 link true /test e2e-rosa
ci/prow/e2e-aws-serial ae1709deb3eb699a620cd49cf8bfca36cf942e01 link true /test e2e-aws-serial
ci/prow/e2e-aws-parallel ae1709deb3eb699a620cd49cf8bfca36cf942e01 link true /test e2e-aws-parallel

Full PR test history. Your PR dashboard.

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.

openshift-ci[bot] avatar Jul 19 '24 18:07 openshift-ci[bot]

Closing this since we're updated to a newer version of controller-runtime.

https://github.com/ComplianceAsCode/compliance-operator/commit/679d325c55585c2165d602b50a09c6cb403e962c

rhmdnd avatar Jan 06 '25 15:01 rhmdnd

https://github.com/ComplianceAsCode/compliance-operator/pull/583

rhmdnd avatar Jan 06 '25 15:01 rhmdnd