Skip to content

Commit

Permalink
Merge pull request #923 from anmazzotti/mitigate_test_flakyness
Browse files Browse the repository at this point in the history
Increase timeout when waiting for reconciler
  • Loading branch information
salasberryfin authored Dec 17, 2024
2 parents 0b5bd18 + ba2ac57 commit 1f0517e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions internal/controllers/capiprovider_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ var _ = Describe("Reconcile CAPIProvider", func() {

dockerProvider := objectFromKey(client.ObjectKeyFromObject(provider), &operatorv1.InfrastructureProvider{})
dockerSecret := objectFromKey(client.ObjectKeyFromObject(provider), &corev1.Secret{})
Eventually(Object(dockerProvider)).ShouldNot(BeNil())
Eventually(Object(dockerSecret)).Should(HaveField("Data", Equal(map[string][]byte{
Eventually(Object(dockerProvider)).WithTimeout(5 * time.Second).ShouldNot(BeNil())
Eventually(Object(dockerSecret)).WithTimeout(5 * time.Second).Should(HaveField("Data", Equal(map[string][]byte{
"CLUSTER_TOPOLOGY": []byte("true"),
"EXP_CLUSTER_RESOURCE_SET": []byte("true"),
"EXP_MACHINE_POOL": []byte("true"),
Expand All @@ -87,7 +87,7 @@ var _ = Describe("Reconcile CAPIProvider", func() {
}}
Expect(cl.Create(ctx, provider)).ToNot(HaveOccurred())

Eventually(Object(provider)).Should(
Eventually(Object(provider)).WithTimeout(5 * time.Second).Should(
HaveField("Status.Name", Equal(provider.Name)))
})

Expand All @@ -101,7 +101,7 @@ var _ = Describe("Reconcile CAPIProvider", func() {
}}
Expect(cl.Create(ctx, provider)).ToNot(HaveOccurred())

Eventually(Object(provider)).Should(
Eventually(Object(provider)).WithTimeout(5 * time.Second).Should(
HaveField("Status.Name", Equal(provider.Spec.Name)))
})

Expand All @@ -116,8 +116,8 @@ var _ = Describe("Reconcile CAPIProvider", func() {

dockerProvider := objectFromKey(client.ObjectKeyFromObject(provider), &operatorv1.InfrastructureProvider{})
dockerSecret := objectFromKey(client.ObjectKeyFromObject(provider), &corev1.Secret{})
Eventually(Object(dockerProvider)).ShouldNot(BeNil())
Eventually(Object(dockerSecret)).ShouldNot(BeNil())
Eventually(Object(dockerProvider)).WithTimeout(5 * time.Second).ShouldNot(BeNil())
Eventually(Object(dockerSecret)).WithTimeout(5 * time.Second).ShouldNot(BeNil())

Eventually(Update(provider, func() {
provider.Spec.Version = "v1.2.3"
Expand All @@ -126,8 +126,8 @@ var _ = Describe("Reconcile CAPIProvider", func() {
}
})).Should(Succeed())

Eventually(Object(dockerProvider)).Should(HaveField("Spec.Version", Equal("v1.2.3")))
Eventually(Object(dockerSecret)).Should(HaveField("Data", Equal(map[string][]byte{
Eventually(Object(dockerProvider)).WithTimeout(5 * time.Second).Should(HaveField("Spec.Version", Equal("v1.2.3")))
Eventually(Object(dockerSecret)).WithTimeout(5 * time.Second).Should(HaveField("Data", Equal(map[string][]byte{
"other": []byte("var"),
"CLUSTER_TOPOLOGY": []byte("true"),
"EXP_CLUSTER_RESOURCE_SET": []byte("true"),
Expand Down Expand Up @@ -177,7 +177,7 @@ var _ = Describe("Reconcile CAPIProvider", func() {
}
})).Should(Succeed())

Eventually(Object(doSecret)).Should(HaveField("Data", Equal(map[string][]byte{
Eventually(Object(doSecret)).WithTimeout(5 * time.Second).Should(HaveField("Data", Equal(map[string][]byte{
"EXP_MACHINE_POOL": []byte("true"),
"CLUSTER_TOPOLOGY": []byte("false"),
"EXP_CLUSTER_RESOURCE_SET": []byte("false"),
Expand Down

0 comments on commit 1f0517e

Please sign in to comment.