def test_actor_exception(self):
    master = Master(port=1235)
    th = threading.Thread(target=master.run)
    th.start()
    time.sleep(1)
    worker1 = Worker('localhost:1235', 1)
    self.assertEqual(1, master.cpu_num)
    parl.connect('localhost:1235')
    with self.assertRaises(exceptions.RemoteError):
        actor = Actor(abcd='a bug')
    actor2 = Actor()
    self.assertEqual(actor2.add_one(1), 2)
    self.assertEqual(0, master.cpu_num)
    master.exit()
    worker1.exit()
def test_actor_exception(self):
    master = Master(port=1235)
    th = threading.Thread(target=master.run)
    th.start()
    time.sleep(1)
    worker1 = Worker('localhost:1235', 1)
    self.assertEqual(1, master.cpu_num)
    parl.connect('localhost:1235')
    with self.assertRaises(exceptions.RemoteError):
        actor = Actor(abcd='a bug')
    actor2 = Actor()
    self.assertEqual(actor2.add_one(1), 2)
    self.assertEqual(0, master.cpu_num)
    master.exit()
    worker1.exit()