X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/f04cfcce18c6e4bd1faf3140ccbc835328580024..ba534230bcc23aaea69e5f256693b9e143200b63:/services/nodemanager/tests/test_computenode_dispatch.py diff --git a/services/nodemanager/tests/test_computenode_dispatch.py b/services/nodemanager/tests/test_computenode_dispatch.py index 95b1329fa6..14cd85e414 100644 --- a/services/nodemanager/tests/test_computenode_dispatch.py +++ b/services/nodemanager/tests/test_computenode_dispatch.py @@ -267,6 +267,16 @@ class ComputeNodeUpdateActorTestCase(testutil.ActorTestMixin, self.updater.sync_node(cloud_node, arv_node).get(self.TIMEOUT) self.driver().sync_node.assert_called_with(cloud_node, arv_node) + @testutil.no_sleep + def test_node_sync_error(self): + self.make_actor() + cloud_node = testutil.cloud_node_mock() + arv_node = testutil.arvados_node_mock() + self.driver().sync_node.side_effect = (IOError, Exception, True) + self.updater.sync_node(cloud_node, arv_node).get(self.TIMEOUT) + self.updater.sync_node(cloud_node, arv_node).get(self.TIMEOUT) + self.updater.sync_node(cloud_node, arv_node).get(self.TIMEOUT) + self.driver().sync_node.assert_called_with(cloud_node, arv_node) class ComputeNodeMonitorActorTestCase(testutil.ActorTestMixin, unittest.TestCase): @@ -351,7 +361,7 @@ class ComputeNodeMonitorActorTestCase(testutil.ActorTestMixin, def test_shutdown_without_arvados_node(self): self.make_actor(start_time=0) self.shutdowns._set_state(True, 600) - self.assertTrue(self.node_actor.shutdown_eligible().get(self.TIMEOUT)) + self.assertIs(True, self.node_actor.shutdown_eligible().get(self.TIMEOUT)) def test_no_shutdown_missing(self): arv_node = testutil.arvados_node_mock(10, job_uuid=None, @@ -376,7 +386,7 @@ class ComputeNodeMonitorActorTestCase(testutil.ActorTestMixin, self.make_actor(11, arv_node) self.shutdowns._set_state(True, 600) self.cloud_client.broken.return_value = True - self.assertTrue(self.node_actor.shutdown_eligible().get(self.TIMEOUT)) + self.assertIs(True, self.node_actor.shutdown_eligible().get(self.TIMEOUT)) def test_no_shutdown_when_window_closed(self): self.make_actor(3, testutil.arvados_node_mock(3, job_uuid=None))