[ARVADOS] updated: 1.1.4-5-gcb6465391
Git user
git at public.curoverse.com
Tue Jul 17 15:02:43 EDT 2018
Summary of changes:
services/nodemanager/arvnodeman/config.py | 2 +-
services/nodemanager/arvnodeman/daemon.py | 2 +-
services/nodemanager/arvnodeman/launcher.py | 3 ++-
services/nodemanager/tests/test_daemon.py | 16 ++++++++++++++++
4 files changed, 20 insertions(+), 3 deletions(-)
via cb64653912a604809c3429f7dbda781741acd18a (commit)
from a4166f402b34e018940ae1df726351e8c52ac1c1 (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 cb64653912a604809c3429f7dbda781741acd18a
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Tue Jul 17 14:47:01 2018 -0400
13804: Fix tests
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/services/nodemanager/arvnodeman/config.py b/services/nodemanager/arvnodeman/config.py
index 8d974872f..617b5626b 100644
--- a/services/nodemanager/arvnodeman/config.py
+++ b/services/nodemanager/arvnodeman/config.py
@@ -57,7 +57,7 @@ class NodeManagerConfig(ConfigParser.SafeConfigParser):
'node_stale_after': str(60 * 60 * 2),
'watchdog': '600',
'node_mem_scaling': '0.95',
- 'consecutive_idle_count': 2},
+ 'consecutive_idle_count': '2'},
'Manage': {'address': '127.0.0.1',
'port': '-1',
'ManagementToken': ''},
diff --git a/services/nodemanager/arvnodeman/daemon.py b/services/nodemanager/arvnodeman/daemon.py
index f34260adb..8ca75a270 100644
--- a/services/nodemanager/arvnodeman/daemon.py
+++ b/services/nodemanager/arvnodeman/daemon.py
@@ -478,7 +478,7 @@ class NodeManagerDaemonActor(actor_class):
for record in self.cloud_nodes.nodes.itervalues():
try:
if (record.shutdown_actor is not None and
- record.size.id == size.id and
+ record.cloud_node.size.id == size.id and
record.shutdown_actor.cancel_shutdown("Node size is in wishlist").get(2)):
return True
except (pykka.ActorDeadError, pykka.Timeout) as e:
diff --git a/services/nodemanager/arvnodeman/launcher.py b/services/nodemanager/arvnodeman/launcher.py
index 888abf5a7..4fe4128ab 100644
--- a/services/nodemanager/arvnodeman/launcher.py
+++ b/services/nodemanager/arvnodeman/launcher.py
@@ -144,7 +144,8 @@ def main(args=None):
config.getint('Daemon', 'boot_fail_after'),
config.getint('Daemon', 'node_stale_after'),
node_setup, node_shutdown, node_monitor,
- max_total_price=config.getfloat('Daemon', 'max_total_price')).tell_proxy()
+ max_total_price=config.getfloat('Daemon', 'max_total_price'),
+ consecutive_idle_count=config.getint('Daemon', 'consecutive_idle_count'),).tell_proxy()
watchdog = WatchdogActor.start(config.getint('Daemon', 'watchdog'),
cloud_node_poller.actor_ref,
diff --git a/services/nodemanager/tests/test_daemon.py b/services/nodemanager/tests/test_daemon.py
index 8050e6981..562ed6dfe 100644
--- a/services/nodemanager/tests/test_daemon.py
+++ b/services/nodemanager/tests/test_daemon.py
@@ -608,10 +608,26 @@ class NodeManagerDaemonActorTestCase(testutil.ActorTestMixin,
monitor = self.monitor_list()[0].proxy()
self.daemon.node_can_shutdown(monitor).get(self.TIMEOUT)
self.assertTrue(self.node_shutdown.start.called)
+ getmock = mock.MagicMock()
+ getmock.get.return_value = False
+ self.last_shutdown.cancel_shutdown.return_value = getmock
self.daemon.update_server_wishlist(
[testutil.MockSize(6)]).get(self.TIMEOUT)
self.busywait(lambda: self.node_setup.start.called)
+ def test_nodes_shutting_down_cancelled(self):
+ size = testutil.MockSize(6)
+ cloud_node = testutil.cloud_node_mock(6, size=size)
+ self.make_daemon([cloud_node], [testutil.arvados_node_mock(6, crunch_worker_state='down')],
+ avail_sizes=[(size, {"cores":1})])
+ self.assertEqual(1, self.alive_monitor_count())
+ monitor = self.monitor_list()[0].proxy()
+ self.daemon.node_can_shutdown(monitor).get(self.TIMEOUT)
+ self.assertTrue(self.node_shutdown.start.called)
+ self.daemon.update_server_wishlist(
+ [testutil.MockSize(6)]).get(self.TIMEOUT)
+ self.busywait(lambda: self.last_shutdown.cancel_shutdown.called)
+
def test_nodes_shutting_down_not_replaced_at_max_nodes(self):
cloud_node = testutil.cloud_node_mock(7)
self.make_daemon([cloud_node], [testutil.arvados_node_mock(7)],
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list