Skip to content

Commit

Permalink
Merge pull request #304 from anynines/fix_connection_configmap_to_use…
Browse files Browse the repository at this point in the history
…_eventually

Fix exposed cluster e2e test to use async assert
  • Loading branch information
mkfdoherty authored Jun 5, 2024
2 parents 4f31398 + f9bf82f commit d855a12
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions test/e2e/postgresql/exposed_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const (
)

var _ = Describe("end-to-end tests for exposed instances", Label("ExternalLoadbalancer", "KindIncompatible"), func() {

Context("Instance exposed via Load Balancer", Ordered, func() {
AfterAll(func() {
Expect(k8sClient.Delete(ctx, instance.GetClientObject())).To(
Expand Down Expand Up @@ -82,15 +81,18 @@ var _ = Describe("end-to-end tests for exposed instances", Label("ExternalLoadba
Expect(err).To(BeNil(),
fmt.Sprintf("failed to parse secret data for service binding %s/%s",
sb.GetNamespace(), sb.GetName()))

})

var connInfo v1.ConfigMap
It("Creates a connection ConfigMap", func() {
Expect(k8sClient.Get(ctx, types.NamespacedName{
Namespace: instance.GetNamespace(),
Name: dsi.ConnectionInfoName(instance.GetName()),
}, &connInfo)).To(Succeed())
Eventually(func() error {
return k8sClient.Get(ctx, types.NamespacedName{
Namespace: instance.GetNamespace(),
Name: dsi.ConnectionInfoName(instance.GetName()),
},
&connInfo,
)
}, asyncOpsTimeoutMins, 1*time.Second).Should(Succeed())

Expect(connInfo.Data).To(HaveKey("primary"),
"connInfo does not contain information about primary database")
Expand All @@ -100,7 +102,6 @@ var _ = Describe("end-to-end tests for exposed instances", Label("ExternalLoadba

Expect(connInfo.Data).To(HaveKey("readOnly"),
"connInfo does not contain information about read only service")

})

It("can write data via public address", func() {
Expand Down

0 comments on commit d855a12

Please sign in to comment.