From c0bfba5b7266488a2db8f7433051337fe2a8c247 Mon Sep 17 00:00:00 2001 From: Simon Beck Date: Wed, 18 Sep 2024 10:53:05 +0200 Subject: [PATCH] Revert "Comment out unit test that triggers fake client bug" This reverts commit 5b26fd192a9f15960462b62bbb02f7e4be2a692a. --- pkg/maintenance/postgresql_test.go | 70 +++++++++++++++--------------- 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/pkg/maintenance/postgresql_test.go b/pkg/maintenance/postgresql_test.go index ba24f4cab..7a0efe849 100644 --- a/pkg/maintenance/postgresql_test.go +++ b/pkg/maintenance/postgresql_test.go @@ -403,42 +403,40 @@ func TestPostgreSQL_DoMaintenance(t *testing.T) { server: getVersionTestHTTPServer(t), shouldSkipRepack: true, }, - // This test fills up the watcher channel, which is currently hardcoded to size 100 - // See https://github.com/kubernetes/kubernetes/issues/116700 - // { - // name: "GivenMaintenanceTooLong_WithUnrelatedSecupdate_ThenExpectNoRepack", - // maintTimeout: 2 * time.Second, - // objs: []client.Object{ - // &stackgresv1.SGCluster{ - // ObjectMeta: metav1.ObjectMeta{ - // Name: "cluster", - // Namespace: "default", - // }, - // Spec: stackgresv1.SGClusterSpec{ - // Postgres: stackgresv1.SGClusterSpecPostgres{ - // Version: "15.0", - // }, - // }, - // }, - // &stackgresv1.SGDbOps{ - // ObjectMeta: metav1.ObjectMeta{ - // Name: "unrelated-securitymaintenance", - // Namespace: "default", - // }, - // Spec: stackgresv1.SGDbOpsSpec{ - // Op: "securityUpgrade", - // SgCluster: "cluster", - // MaxRetries: pointer.Int(1), - // SecurityUpgrade: &stackgresv1.SGDbOpsSpecSecurityUpgrade{ - // Method: pointer.String("InPlace"), - // }, - // }, - // }, - // }, - // server: getVersionTestHTTPServer(t), - // updatedOps: "securityUpgrade", - // shouldSkipRepack: true, - // }, + { + name: "GivenMaintenanceTooLong_WithUnrelatedSecupdate_ThenExpectNoRepack", + maintTimeout: 2 * time.Second, + objs: []client.Object{ + &stackgresv1.SGCluster{ + ObjectMeta: metav1.ObjectMeta{ + Name: "cluster", + Namespace: "default", + }, + Spec: stackgresv1.SGClusterSpec{ + Postgres: stackgresv1.SGClusterSpecPostgres{ + Version: "15.0", + }, + }, + }, + &stackgresv1.SGDbOps{ + ObjectMeta: metav1.ObjectMeta{ + Name: "unrelated-securitymaintenance", + Namespace: "default", + }, + Spec: stackgresv1.SGDbOpsSpec{ + Op: "securityUpgrade", + SgCluster: "cluster", + MaxRetries: pointer.Int(1), + SecurityUpgrade: &stackgresv1.SGDbOpsSpecSecurityUpgrade{ + Method: pointer.String("InPlace"), + }, + }, + }, + }, + server: getVersionTestHTTPServer(t), + updatedOps: "securityUpgrade", + shouldSkipRepack: true, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) {