[ARVADOS] updated: d01d6bdf901b49e8856e199a131fb263f98b370e
git at public.curoverse.com
git at public.curoverse.com
Wed Nov 18 09:45:13 EST 2015
Summary of changes:
services/nodemanager/tests/test_daemon.py | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
via d01d6bdf901b49e8856e199a131fb263f98b370e (commit)
from 4c5e5f9070e4e0fd9b07757c546b3bae48f2b664 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
commit d01d6bdf901b49e8856e199a131fb263f98b370e
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Wed Nov 18 09:45:08 2015 -0500
5353: Add a couple comments to tests.
diff --git a/services/nodemanager/tests/test_daemon.py b/services/nodemanager/tests/test_daemon.py
index 2510c79..e0f0517 100644
--- a/services/nodemanager/tests/test_daemon.py
+++ b/services/nodemanager/tests/test_daemon.py
@@ -613,6 +613,9 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
(testutil.MockSize(2), {"cores":2})]
self.make_daemon(want_sizes=[small, small, small, big],
avail_sizes=avail_sizes, max_nodes=4)
+
+ # the daemon runs in another thread, so we need to wait and see
+ # if it does all the work we're expecting it to do before stopping it.
self.busywait(lambda: self.node_setup.start.call_count == 4)
booting = self.daemon.booting.get(self.TIMEOUT)
self.stop_proxy(self.daemon)
@@ -630,13 +633,15 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
(testutil.MockSize(2), {"cores":2})]
self.make_daemon(want_sizes=[small, small, small, big],
avail_sizes=avail_sizes, max_nodes=3)
+
+ # the daemon runs in another thread, so we need to wait and see
+ # if it does all the work we're expecting it to do before stopping it.
self.busywait(lambda: self.node_setup.start.call_count == 3)
booting = self.daemon.booting.get(self.TIMEOUT)
self.stop_proxy(self.daemon)
sizecounts = {a[0].id: 0 for a in avail_sizes}
for b in booting.itervalues():
sizecounts[b.cloud_size.get().id] += 1
- logging.info(sizecounts)
self.assertEqual(2, sizecounts[small.id])
self.assertEqual(1, sizecounts[big.id])
@@ -692,15 +697,25 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
avail_sizes=avail_sizes,
max_nodes=4,
max_total_price=4)
+ # the daemon runs in another thread, so we need to wait and see
+ # if it does all the work we're expecting it to do before stopping it.
self.busywait(lambda: self.node_setup.start.call_count == 3)
booting = self.daemon.booting.get()
self.stop_proxy(self.daemon)
+
+ # technically something could happen between finishing the busywait and
+ # stopping the daemon so check again
self.assertEqual(3, self.node_setup.start.call_count)
+
sizecounts = {a[0].id: 0 for a in avail_sizes}
for b in booting.itervalues():
sizecounts[b.cloud_size.get().id] += 1
logging.info(sizecounts)
- # The way the update_server_wishlist() works effectively results in a
- # round-robin creation of one node of each size in the wishlist
+
+ # Booting 3 small nodes and not booting a big node would also partially
+ # satisfy the wishlist and come in under the price cap, however the way
+ # the update_server_wishlist() currently works effectively results in a
+ # round-robin creation of one node of each size in the wishlist, so
+ # test for that.
self.assertEqual(2, sizecounts[small.id])
self.assertEqual(1, sizecounts[big.id])
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list