-
Notifications
You must be signed in to change notification settings - Fork 551
Fix csv e2e tests #2689
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
Fix csv e2e tests #2689
Conversation
Flakiness tests: csv e2e
copied csv
NOTE: turns out |
/retest-required |
/test flaky-e2e-tests |
@perdasilva: No presubmit jobs available for operator-framework/operator-lifecycle-manager@master In response to this:
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. |
/test flaky-e2e-tests |
@perdasilva: No presubmit jobs available for operator-framework/operator-lifecycle-manager@master In response to this:
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. |
/test flaky-e2e-tests |
@perdasilva: No presubmit jobs available for operator-framework/operator-lifecycle-manager@master In response to this:
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. |
@exdx regarding the Owned to Required change: I think that's due to the order of the tests having changed. If you look at master that test uses |
/test flaky-e2e-tests |
@perdasilva: No presubmit jobs available for operator-framework/operator-lifecycle-manager@master In response to this:
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. |
Pulling this down locally and playing around with it now. |
Ran this locally and it passed - It seems like we're still leaking a good chunk of resources: $ k get ns
csv-e2e-lstsz Active 11m
csv-sa-non-csv-e2e-mljdzrwjw6 Active 10m
$ k get crds
apiczm5ks.example.com 2022-03-15T20:42:45Z
apil9fwzs.example.com 2022-03-15T20:42:47Z
apitwfb8s.example.com 2022-03-15T20:42:55Z
apizmkmns.example.com 2022-03-15T20:42:58Z
$ k get apiservices
v1.example.com Local True 14m
$ k get clusterroles
apil9fwzs.example.com-v1-view 2022-03-15T20:42:54Z
apil9fwzs.example.com-v1-admin 2022-03-15T20:42:54Z
apil9fwzs.example.com-v1-crdview 2022-03-15T20:42:54Z
apil9fwzs.example.com-v1-edit 2022-03-15T20:42:54Z
csv-e2e-lstsz-operatorgroup-view 2022-03-15T20:42:58Z
csv-e2e-lstsz-operatorgroup-edit 2022-03-15T20:42:58Z
csv-e2e-lstsz-operatorgroup-admin 2022-03-15T20:42:58Z
csv-sa-non-csv-e2e-mljdzrwjw6-operatorgroup-edit 2022-03-15T20:43:42Z
csv-sa-non-csv-e2e-mljdzrwjw6-operatorgroup-view 2022-03-15T20:43:42Z
csv-sa-non-csv-e2e-mljdzrwjw6-operatorgroup-admin 2022-03-15T20:43:42Z
dep-799x5 2022-03-15T20:47:03Z
dep-k58qp 2022-03-15T20:47:03Z
dep-mnjvd 2022-03-15T20:47:16Z
$ k get clusterrolebindings
dep-sszsz ClusterRole/dep-k58qp 11m
dep-9nfrk ClusterRole/dep-799x5 11m
dep-qn8x9 ClusterRole/dep-mnjvd 11m
hat-server9rslt-service-system:auth-delegator ClusterRole/system:auth-delegator 10m |
43f1d23
to
a0bc8ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments below.
1bc3766
to
d5b2e13
Compare
It looks like we're still leaking a namespace + CRD: $ k get ns
NAME STATUS AGE
csv-sa-non-csv-e2e-vplnjkxkrr Active 18m
...
$ k get crd
k get crd
NAME CREATED AT
api8srgns.example.com 2022-03-29T15:43:55Z
... |
e796376
to
b85a279
Compare
cd0d8b1
to
a1c404d
Compare
test/e2e/copied_csv_e2e_test.go
Outdated
err := ctx.Ctx().Client().Delete(context.Background(), &csv) | ||
if err != nil && k8serrors.IsNotFound(err) { | ||
return err | ||
} | ||
|
||
return nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: return client.IgnoreNotFound(...)
test/e2e/copied_csv_e2e_test.go
Outdated
operatorsv1alpha1 "github.com/operator-framework/api/pkg/operators/v1alpha1" | ||
"github.com/operator-framework/operator-lifecycle-manager/test/e2e/ctx" | ||
corev1 "k8s.io/api/core/v1" | ||
k8serrors "k8s.io/apimachinery/pkg/api/errors" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: apierrors
test/e2e/webhook_e2e_test.go
Outdated
@@ -415,7 +415,7 @@ var _ = Describe("CSVs with a Webhook", func() { | |||
|
|||
// Make sure old resources are cleaned up. | |||
Eventually(func() bool { | |||
return csvExists(crc, csv.Spec.Replaces) | |||
return csvExists(testNamespace, crc, csv.Spec.Replaces) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#2718 landed since this PR has opened - do we need to update this to use the test generated namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I fixed this in the latest force push)
fetched, err := newKubeClient().KubernetesInterface().CoreV1().Pods(catalogSource.GetNamespace()).List(context.Background(), metav1.ListOptions{LabelSelector: "olm.catalogSource=" + catalogSource.GetName()}) | ||
listOpts := metav1.ListOptions{ | ||
LabelSelector: "olm.catalogSource=" + catalogSource.GetName(), | ||
FieldSelector: "status.phase=Running", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 looks reasonable to me
// issue: https://github.com/operator-framework/operator-lifecycle-manager/issues/2646 | ||
It("[FLAKE] can satisfy an associated ClusterServiceVersion's ownership requirement", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like we've dropped this flake label when looking at the full file now. Should we graduate this test once these changes land and we have sufficient proof?
}) | ||
}) | ||
When("a copied csv exists", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this a duplicate test case compared to the dedicated copied CSV e2e suite?
test/e2e/csv_e2e_test.go
Outdated
) | ||
AfterEach(func() { | ||
if target.GetName() != "" { | ||
Expect(ctx.Ctx().Client().Delete(context.Background(), &target)).To(Succeed()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to use the TeardownNamespace helper function so we can also gather artifacts if this test case fails?
a1c404d
to
2df6478
Compare
|
4d6401f
to
d2a6a9d
Compare
Signed-off-by: perdasilva <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: perdasilva, timflannagan 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 |
Signed-off-by: perdasilva [email protected]
Description of the change:
This PR refactors CSV e2e tests such that each test uses its own namespace. It also factors the
disabling copied CSV
e2e tests to their own file.Motivation for the change:
Flaky tests driving everyone nuts
Closes: #2646
Closes: #2639
Closes: #2643
Closes: #2634
Closes: #2641
Reviewer Checklist
/doc
[FLAKE]
are truly flaky[FLAKE]
tag are no longer flaky