File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -383,12 +383,17 @@ def test_calico_interfaces_removed_on_snap_remove(self):
383383 print ("Waiting for machine {}" .format (vm .vm_name ))
384384 vm .run ("/snap/bin/microk8s.status --wait-ready --timeout 240" )
385385 timeout = time .time () + 240
386- while time .time () <= timeout :
387- pods = vm .run ("/snap/bin/microk8s.kubectl get po -n kube-system -o wide" )
388- for line in pods .decode ().splitlines ():
389- if "calico" in line and "Running" in line :
390- break
386+ ready = False
387+ while time .time () <= timeout and not ready :
388+ try :
389+ pods = vm .run ("/snap/bin/microk8s.kubectl get po -n kube-system -o wide" )
390+ for line in pods .decode ().splitlines ():
391+ if "calico" in line and "Running" in line :
392+ ready = True
393+ except ChildProcessError :
394+ print ("Waiting for k8s pods to come up" )
391395 time .sleep (5 )
396+ assert ready
392397 vm .run ("snap remove --purge microk8s" )
393398 interfaces = vm .run ("/sbin/ip a" )
394399 assert "cali" not in interfaces .decode ()
You can’t perform that action at this time.
0 commit comments