def test_reset_actor(self):
    master = Master(port=1237)
    th = threading.Thread(target=master.run)
    th.start()
    time.sleep(1)
    worker1 = Worker('localhost:1237', 4)
    parl.connect('localhost:1237')
    for i in range(10):
        actor = Actor()
        ret = actor.add_one(1)
        self.assertEqual(ret, 2)
    del actor
    time.sleep(20)
    self.assertEqual(master.cpu_num, 4)
    worker1.exit()
    master.exit()
def test_reset_actor(self):
    master = Master(port=1237)
    th = threading.Thread(target=master.run)
    th.start()
    time.sleep(1)
    worker1 = Worker('localhost:1237', 4)
    parl.connect('localhost:1237')
    for i in range(10):
        actor = Actor()
        ret = actor.add_one(1)
        self.assertEqual(ret, 2)
    del actor
    time.sleep(20)
    self.assertEqual(master.cpu_num, 4)
    worker1.exit()
    master.exit()