From: Peter Amstutz Date: Fri, 26 Feb 2016 16:38:50 +0000 (-0500) Subject: 8437: Add missing test. X-Git-Tag: 1.1.0~1097^2~1 X-Git-Url: https://git.arvados.org/arvados.git/commitdiff_plain/0a1c109684c62f0bc42e7dca30319fc8222dbef7 8437: Add missing test. --- diff --git a/services/nodemanager/tests/test_failure.py b/services/nodemanager/tests/test_failure.py new file mode 100644 index 0000000000..b7127fc2bb --- /dev/null +++ b/services/nodemanager/tests/test_failure.py @@ -0,0 +1,30 @@ +#!/usr/bin/env python + +from __future__ import absolute_import, print_function + +import logging +import unittest + +import mock +import pykka + +from . import testutil + +import arvnodeman.fullstopactor + +class BogusActor(arvnodeman.fullstopactor.FullStopActor): + def doStuff(self): + raise MemoryError + +class ActorUnhandledExceptionTest(unittest.TestCase): + def test1(self): + with mock.patch('os.killpg') as killpg_mock: + act = BogusActor.start() + act.tell({ + 'command': 'pykka_call', + 'attr_path': ("doStuff",), + 'args': [], + 'kwargs': {} + }) + act.stop(block=True) + self.assertTrue(killpg_mock.called)