@@ -53,7 +53,7 @@ var _ = Describe("Exchange", func() {
5353 var err error
5454 exchangeInfo , err = rabbitClient .GetExchange (exchange .Spec .Vhost , exchange .Name )
5555 return err
56- }, 10 , 2 ).Should (BeNil ())
56+ }, waitUpdatedStatusCondition , 2 ).Should (BeNil ())
5757
5858 Expect (* exchangeInfo ).To (MatchFields (IgnoreExtras , Fields {
5959 "Name" : Equal (exchange .Spec .Name ),
@@ -66,9 +66,12 @@ var _ = Describe("Exchange", func() {
6666
6767 By ("updating status condition 'Ready'" )
6868 fetched := topology.Exchange {}
69- Expect (k8sClient .Get (ctx , types.NamespacedName {Name : exchange .Name , Namespace : exchange .Namespace }, & fetched )).To (Succeed ())
7069
71- Expect (fetched .Status .Conditions ).To (HaveLen (1 ))
70+ Eventually (func () []topology.Condition {
71+ Expect (k8sClient .Get (ctx , types.NamespacedName {Name : exchange .Name , Namespace : exchange .Namespace }, & fetched )).To (Succeed ())
72+ return fetched .Status .Conditions
73+ }, 20 , 2 ).Should (HaveLen (1 ), "Exchange status condition should be present" )
74+
7275 readyCondition := fetched .Status .Conditions [0 ]
7376 Expect (string (readyCondition .Type )).To (Equal ("Ready" ))
7477 Expect (readyCondition .Status ).To (Equal (corev1 .ConditionTrue ))
0 commit comments