[ARVADOS] updated: 131b0d92bd2154a97d1f13c26073bc47feba3c20
git at public.curoverse.com
git at public.curoverse.com
Mon Dec 15 14:47:03 EST 2014
Summary of changes:
services/nodemanager/arvnodeman/daemon.py | 1 +
services/nodemanager/tests/test_daemon.py | 25 +++++++++++++++++--------
2 files changed, 18 insertions(+), 8 deletions(-)
via 131b0d92bd2154a97d1f13c26073bc47feba3c20 (commit)
from 50b8fd6c6dd1137a06b7849665d8ba4276f62ba2 (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 131b0d92bd2154a97d1f13c26073bc47feba3c20
Author: Brett Smith <brett at curoverse.com>
Date: Mon Dec 15 14:46:43 2014 -0500
4818: Node Manager unpairs Arvados node when cloud node shuts down.
Without this, Node Manager doesn't correctly pair the Arvados node
with a new cloud node that's booted later. Closes #4818.
diff --git a/services/nodemanager/arvnodeman/daemon.py b/services/nodemanager/arvnodeman/daemon.py
index d03d145..53af933 100644
--- a/services/nodemanager/arvnodeman/daemon.py
+++ b/services/nodemanager/arvnodeman/daemon.py
@@ -179,6 +179,7 @@ class NodeManagerDaemonActor(actor_class):
break
for key, record in self.cloud_nodes.orphans.iteritems():
record.actor.stop()
+ record.cloud_node = None
self.shutdowns.pop(key, None)
def update_arvados_nodes(self, nodelist):
diff --git a/services/nodemanager/tests/test_daemon.py b/services/nodemanager/tests/test_daemon.py
index 0f146a1..8245fe2 100644
--- a/services/nodemanager/tests/test_daemon.py
+++ b/services/nodemanager/tests/test_daemon.py
@@ -56,15 +56,17 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
self.stop_proxy(self.daemon)
self.assertTrue(self.node_setup.start.called)
+ def check_monitors_arvados_nodes(self, *arv_nodes):
+ self.assertItemsEqual(arv_nodes, pykka.get_all(
+ monitor.proxy().arvados_node
+ for monitor in self.monitor_list() if monitor.is_alive()))
+
def test_node_pairing(self):
cloud_node = testutil.cloud_node_mock(1)
arv_node = testutil.arvados_node_mock(1)
self.make_daemon([cloud_node], [arv_node])
self.stop_proxy(self.daemon)
- self.assertEqual(1, self.alive_monitor_count())
- self.assertIs(
- self.monitor_list()[0].proxy().arvados_node.get(self.TIMEOUT),
- arv_node)
+ self.check_monitors_arvados_nodes(arv_node)
def test_node_pairing_after_arvados_update(self):
cloud_node = testutil.cloud_node_mock(2)
@@ -73,10 +75,17 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
arv_node = testutil.arvados_node_mock(2)
self.daemon.update_arvados_nodes([arv_node]).get(self.TIMEOUT)
self.stop_proxy(self.daemon)
- self.assertEqual(1, self.alive_monitor_count())
- self.assertIs(
- self.monitor_list()[0].proxy().arvados_node.get(self.TIMEOUT),
- arv_node)
+ self.check_monitors_arvados_nodes(arv_node)
+
+ def test_arvados_node_un_and_re_paired(self):
+ arv_node = testutil.arvados_node_mock(3)
+ self.make_daemon([testutil.cloud_node_mock(3)], [arv_node])
+ self.check_monitors_arvados_nodes(arv_node)
+ self.daemon.update_cloud_nodes([]).get(self.TIMEOUT)
+ self.assertEqual(0, self.alive_monitor_count())
+ self.daemon.update_cloud_nodes([testutil.cloud_node_mock(3)])
+ self.stop_proxy(self.daemon)
+ self.check_monitors_arvados_nodes(arv_node)
def test_old_arvados_node_not_double_assigned(self):
arv_node = testutil.arvados_node_mock(3, age=9000)
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list