+
+ def test_issue_slurm_drain_retry(self, proc_mock):
+ proc_mock.side_effect = iter([OSError, '', OSError, 'drng\n'])
+ self.check_success_after_reset(proc_mock, timer=False)
+
+ def test_arvados_node_cleaned_after_shutdown(self, proc_mock):
+ proc_mock.return_value = 'drain\n'
+ super(SLURMComputeNodeShutdownActorTestCase,
+ self).test_arvados_node_cleaned_after_shutdown()
+
+ def test_cancellable_shutdown(self, proc_mock):
+ proc_mock.return_value = 'other\n'
+ super(SLURMComputeNodeShutdownActorTestCase,
+ self).test_cancellable_shutdown()
+
+ def test_uncancellable_shutdown(self, proc_mock):
+ proc_mock.return_value = 'other\n'
+ super(SLURMComputeNodeShutdownActorTestCase,
+ self).test_uncancellable_shutdown()
+
+@mock.patch('subprocess.check_output')
+class SLURMComputeNodeUpdateActorTestCase(ComputeNodeUpdateActorTestCase):
+ ACTOR_CLASS = slurm_dispatch.ComputeNodeUpdateActor
+
+ def test_update_node_weight(self, check_output):
+ self.make_actor()
+ cloud_node = testutil.cloud_node_mock()
+ arv_node = testutil.arvados_node_mock()
+ self.updater.sync_node(cloud_node, arv_node).get(self.TIMEOUT)
+ check_output.assert_called_with(['scontrol', 'update', 'NodeName=compute99', 'Weight=99000'])