mirror of
https://github.com/wassname/ray.git
synced 2026-08-15 12:45:23 +08:00
Get failed worker information (#114)
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user