Get failed worker information (#114)

This commit is contained in:
mehrdadn
2016-06-17 15:01:48 -07:00
committed by Philipp Moritz
parent 1b68e10f17
commit 0e5feecd65
9 changed files with 104 additions and 3 deletions
+19
View File
@@ -242,6 +242,25 @@ class APITest(unittest.TestCase):
services.cleanup()
class TaskStatusTest(unittest.TestCase):
def testFailedTask(self):
test_dir = os.path.dirname(os.path.abspath(__file__))
test_path = os.path.join(test_dir, "test_worker.py")
services.start_singlenode_cluster(return_drivers=False, num_workers_per_objstore=3, worker_path=test_path)
test_functions.test_alias_f()
test_functions.throw_exception_fct()
test_functions.throw_exception_fct()
time.sleep(1)
result = ray.task_info()
self.assertTrue(len(result['failed_tasks']) == 2)
task_ids = set()
for task in result['failed_tasks']:
self.assertTrue(task.has_key('worker_address'))
self.assertTrue(task.has_key('operationid'))
self.assertEqual(task.get('error_message'), "Test function intentionally failed.")
self.assertTrue(task['operationid'] not in task_ids)
task_ids.add(task['operationid'])
class ReferenceCountingTest(unittest.TestCase):
def testDeallocation(self):