Skip to content

Commit be7049d

Browse files
count only active ns and wait for namespace clean up (#2585)
Signed-off-by: akihikokuroda <[email protected]>
1 parent fd3322a commit be7049d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/e2e/csv_e2e_test.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"k8s.io/apimachinery/pkg/api/equality"
2020
k8serrors "k8s.io/apimachinery/pkg/api/errors"
2121
"k8s.io/apimachinery/pkg/api/meta"
22+
"k8s.io/apimachinery/pkg/fields"
2223
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
2324
k8slabels "k8s.io/apimachinery/pkg/labels"
2425
"k8s.io/apimachinery/pkg/runtime"
@@ -4247,6 +4248,10 @@ var _ = Describe("Disabling copied CSVs", func() {
42474248
return nil
42484249
}).Should(Succeed())
42494250
TeardownNamespace(ns.GetName())
4251+
Eventually(func() error {
4252+
var namespace corev1.Namespace
4253+
return ctx.Ctx().Client().Get(context.Background(), client.ObjectKeyFromObject(&ns), &namespace)
4254+
}).Should(WithTransform(k8serrors.IsNotFound, BeTrue()))
42504255
})
42514256

42524257
When("an operator is installed in AllNamespace mode", func() {
@@ -4403,7 +4408,7 @@ var _ = Describe("Disabling copied CSVs", func() {
44034408
}
44044409

44054410
var namespaces corev1.NamespaceList
4406-
if err := ctx.Ctx().Client().List(context.TODO(), &namespaces, &client.ListOptions{}); err != nil {
4411+
if err := ctx.Ctx().Client().List(context.TODO(), &namespaces, &client.ListOptions{FieldSelector: fields.SelectorFromSet(map[string]string{"status.phase": "Active"})}); err != nil {
44074412
return err
44084413
}
44094414

0 commit comments

Comments
 (0)