Skip to content

Commit

Permalink
tests: Disconnect from databases before starting cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oxyno-zeta committed Apr 10, 2024
1 parent 763e382 commit 4677d44
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions internal/controller/postgresql/suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,10 @@ var _ = AfterSuite(func() {
})

func cleanupFunction() {
for k, _ := range dbConns {
disconnectConnFromKey(k)
}

// Force delete pgec
err := deletePGEC(ctx, k8sClient, pgecName, pgecNamespace)
Expect(err).ToNot(HaveOccurred())
Expand All @@ -243,10 +247,6 @@ func cleanupFunction() {
Expect(err).ToNot(HaveOccurred())
err = deleteSecret(ctx, k8sClient, editedSecretName, pgurNamespace)
Expect(err).ToNot(HaveOccurred())

for k, _ := range dbConns {
disconnectConnFromKey(k)
}
}

func getSecret(ctx context.Context, cli client.Client, name, namespace string) (*corev1.Secret, error) {
Expand Down

0 comments on commit 4677d44

Please sign in to comment.