Increase watermark sleep in tests for reliability.
The nodepool tests depend on watermark sleep being long enough that all of the fake nodes are marked ready before the next deficit check. If it is not long enough then the tests may boot extra servers causing asserts in tests to fail. Increase watermark sleep to one second from half a second and let each test sleep for three seconds before checking node states. Change-Id: Ia94527b46bad26b184af8fa02b3a1e2a1f7a3430
This commit is contained in:
parent
b6539f9cdd
commit
37034efc30
|
@ -80,9 +80,9 @@ class TestNodepool(tests.DBTestCase):
|
|||
def test_node(self):
|
||||
"""Test that an image and node are created"""
|
||||
configfile = self.setup_config('node.yaml')
|
||||
pool = nodepool.nodepool.NodePool(configfile, watermark_sleep=0.5)
|
||||
pool = nodepool.nodepool.NodePool(configfile, watermark_sleep=1)
|
||||
pool.start()
|
||||
time.sleep(2)
|
||||
time.sleep(3)
|
||||
self.waitForNodes(pool)
|
||||
|
||||
with pool.getDB().getSession() as session:
|
||||
|
@ -96,9 +96,9 @@ class TestNodepool(tests.DBTestCase):
|
|||
def test_subnodes(self):
|
||||
"""Test that an image and node are created"""
|
||||
configfile = self.setup_config('subnodes.yaml')
|
||||
pool = nodepool.nodepool.NodePool(configfile, watermark_sleep=0.5)
|
||||
pool = nodepool.nodepool.NodePool(configfile, watermark_sleep=1)
|
||||
pool.start()
|
||||
time.sleep(2)
|
||||
time.sleep(3)
|
||||
self.waitForNodes(pool)
|
||||
|
||||
with pool.getDB().getSession() as session:
|
||||
|
@ -121,9 +121,9 @@ class TestNodepool(tests.DBTestCase):
|
|||
def test_node_az(self):
|
||||
"""Test that an image and node are created with az specified"""
|
||||
configfile = self.setup_config('node_az.yaml')
|
||||
pool = nodepool.nodepool.NodePool(configfile, watermark_sleep=0.5)
|
||||
pool = nodepool.nodepool.NodePool(configfile, watermark_sleep=1)
|
||||
pool.start()
|
||||
time.sleep(2)
|
||||
time.sleep(3)
|
||||
self.waitForNodes(pool)
|
||||
|
||||
with pool.getDB().getSession() as session:
|
||||
|
|
Loading…
Reference in New Issue