File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
tests/composition/message_broker Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -181,12 +181,21 @@ def _await_port_ready(site: Site) -> None:
181181
182182
183183def _await_shovels_ready (site : Site ) -> None :
184+ # TODO: try reducing the waiting time here
184185 for _ in range (180 ):
185- raw = json .loads (site .run (["rabbitmqctl" , "shovel_status" , "--formatter" , "json" ]).stdout )
186- if all (shovel ["state" ] == "running" for shovel in raw ):
186+ try :
187+ raw = site .run (["rabbitmqctl" , "shovel_status" , "--formatter" , "json" ]).stdout
188+ except subprocess .CalledProcessError :
189+ logger .exception ("Failed to get shovel status on %s; waiting..." , site .id )
190+ time .sleep (1 )
191+ continue
192+
193+ data = json .loads (raw )
194+ if all (shovel ["state" ] == "running" for shovel in data ):
187195 return
196+ logger .info ("Shovels on %s are not running. Waiting..." , site .id )
188197 time .sleep (1 )
189- raise Timeout (f "Rabbitmq shovels not started properly: { raw !r } " )
198+ raise Timeout ("Rabbitmq shovels not started properly. " )
190199
191200
192201@contextmanager
You can’t perform that action at this time.
0 commit comments