Skip to content

Commit

Permalink
fix flaky integration test
Browse files Browse the repository at this point in the history
Signed-off-by: Guilherme Cassolato <guicassolato@gmail.com>
  • Loading branch information
guicassolato committed Nov 8, 2024
1 parent 2fd9c84 commit 89e7e9e
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (
"github.com/kuadrant/kuadrant-operator/tests"
)

var _ = Describe("Target status reconciler", func() {
var _ = Describe("Policy discoverability reconciler", func() {
const (
testTimeOut = SpecTimeout(2 * time.Minute)
afterEachTimeOut = NodeTimeout(3 * time.Minute)
Expand Down Expand Up @@ -203,15 +203,13 @@ var _ = Describe("Target status reconciler", func() {

Eventually(policyAcceptedAndTargetsAffected(ctx, routePolicy1)).WithContext(ctx).Should(BeTrue())

routePolicy2 := policyFactory(func(p *kuadrantv1.AuthPolicy) { // another policy that targets the same route. this policy will not be accepted
routePolicy2 := policyFactory(func(p *kuadrantv1.AuthPolicy) { // another policy that targets the same route
p.Name = "route-auth-2"
})
Expect(k8sClient.Create(ctx, routePolicy2)).To(Succeed())

Eventually(func() bool {
return policyAcceptedAndTargetsAffected(ctx, routePolicy1)() &&
!tests.IsAuthPolicyAccepted(ctx, testClient(), routePolicy2)() &&
!routeAffected(ctx, TestHTTPRouteName, policyAffectedCondition, client.ObjectKeyFromObject(routePolicy2))
return policyAcceptedAndTargetsAffected(ctx, routePolicy1)() && policyAcceptedAndTargetsAffected(ctx, routePolicy2)()
}).WithContext(ctx).Should(BeTrue())
}, testTimeOut)

Expand Down

0 comments on commit 89e7e9e

Please sign in to comment.