Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose test clean up issues in compliance scan controller #419

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rhmdnd
Copy link

@rhmdnd rhmdnd commented Sep 19, 2023

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.

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.
@openshift-ci
Copy link

openshift-ci bot commented Sep 19, 2023

[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

BeforeEach(func() {
// Create the pods and the secret for the test
createFakeScanPods(reconciler, compliancescaninstance.Name, nodeinstance1.Name, nodeinstance2.Name)
createFakeRsSecret(reconciler, compliancescaninstance.Name)
secret, err = createFakeRsSecret(reconciler, compliancescaninstance.Name)
Expect(err).ToNot(HaveOccurred())
Copy link
Author

Choose a reason for hiding this comment

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

This is failing because the error returned is a 409, even though we expect createFakeRsSecret to create the secret we want to test with...

Seems like something isn't cleaning up properly?

@rhmdnd
Copy link
Author

rhmdnd commented Sep 20, 2023

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 

@openshift-merge-robot
Copy link
Collaborator

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.

Copy link

openshift-ci bot commented May 10, 2024

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

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.

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.

None yet

2 participants