diff --git a/supports/integration-test/util.py b/supports/integration-test/util.py index 7c37bb0874c..b19fb568951 100644 --- a/supports/integration-test/util.py +++ b/supports/integration-test/util.py @@ -186,10 +186,14 @@ def wait_cmdlets(cids): num_complete = 0 complete = False while not complete: - for cid in cids: - cmdlet = get_cmdlet(cid) + i = 0 + while i < len(cids): + cmdlet = get_cmdlet(cids[i]) if cmdlet['state'] == "DONE" or cmdlet['state'] == "FAILED": num_complete += 1 + cids.pop(i) + else: + i += 1 if num_complete == num_cmds: complete = True if complete: