Fix node data retrieval race in test_failed_provider

Once we start deleting nodes in test_failed_provider we can't count on
getNode() giving us a node for a previous request because that node may
have been deleted. Check that node is a valid value before accessing its
provider value to avoid this race.

Change-Id: Ie6b20f1a66de7865223a7ecf5785e2446afc7804
Clark Boylan 2018-01-18 13:18:34 -08:00
parent 46706ae06b
commit 63dbab87df
1 changed files with 1 additions and 1 deletions

View File

@ -976,7 +976,7 @@ class TestLauncher(tests.DBTestCase):
provider2_second = None
nodes = map(pool.zk.getNode, pool.zk.getNodes())
for node in nodes:
if node.provider == 'fake-provider2':
if node and node.provider == 'fake-provider2':
provider2_second = node
# Now delete the new node we had provider2 build. At this point