Expose test clean up issues in compliance scan controller
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.
[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
- ~~OWNERS~~ [rhmdnd]
Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment
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
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.
@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.
Closing this since we're updated to a newer version of controller-runtime.
https://github.com/ComplianceAsCode/compliance-operator/commit/679d325c55585c2165d602b50a09c6cb403e962c
https://github.com/ComplianceAsCode/compliance-operator/pull/583