Followup test improvement to use iterate_timeout
This was suggested in review. Pushing this so we don't forget. Change-Id: If899965db23d821dfc45d77629a86e3c854be172
This commit is contained in:
		@@ -440,7 +440,7 @@ class TestNodePoolBuilder(tests.DBTestCase):
 | 
				
			|||||||
        # Wait for the build to fail before we replace our config. Otherwise
 | 
					        # Wait for the build to fail before we replace our config. Otherwise
 | 
				
			||||||
        # we may replace the config before we build the image.
 | 
					        # we may replace the config before we build the image.
 | 
				
			||||||
        found = False
 | 
					        found = False
 | 
				
			||||||
        while not found:
 | 
					        for _ in iterate_timeout(10, Exception, 'image builds to fail', 0.1):
 | 
				
			||||||
            builds = self.zk.getBuilds('fake-image')
 | 
					            builds = self.zk.getBuilds('fake-image')
 | 
				
			||||||
            for build in builds:
 | 
					            for build in builds:
 | 
				
			||||||
                # Lexicographical order
 | 
					                # Lexicographical order
 | 
				
			||||||
@@ -451,6 +451,8 @@ class TestNodePoolBuilder(tests.DBTestCase):
 | 
				
			|||||||
                    found = build.id
 | 
					                    found = build.id
 | 
				
			||||||
                    break
 | 
					                    break
 | 
				
			||||||
                time.sleep(0.1)
 | 
					                time.sleep(0.1)
 | 
				
			||||||
 | 
					            if found:
 | 
				
			||||||
 | 
					                break
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Now replace the config with a valid config and check that the image
 | 
					        # Now replace the config with a valid config and check that the image
 | 
				
			||||||
        # builds successfully. Finally check that the failed image is gone.
 | 
					        # builds successfully. Finally check that the failed image is gone.
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user