raise self.exp
def ping(self):
+ # Called by WatchdogActorTest, this delay is longer than the test timeout
+ # of 1 second, which should cause the watchdog ping to fail.
time.sleep(2)
+ return True
class ActorUnhandledExceptionTest(unittest.TestCase):
def test_fatal_error(self):
@mock.patch('os.kill')
def test_time_timout(self, kill_mock):
act = BogusActor.start(OSError(errno.ENOENT, ""))
- watch = arvnodeman.baseactor.WatchdogActor.start(1)
+ watch = arvnodeman.baseactor.WatchdogActor.start(1, act)
watch.stop(block=True)
act.stop(block=True)
self.assertTrue(kill_mock.called)