From ce4e5ec54421d7bab81d453f2c3162579c6652a7 Mon Sep 17 00:00:00 2001 From: Robert Nishihara Date: Mon, 29 Aug 2016 22:52:13 -0700 Subject: [PATCH] Fix failure_test.py. --- test/failure_test.py | 30 +----------------------------- test/test_functions.py | 14 -------------- 2 files changed, 1 insertion(+), 43 deletions(-) diff --git a/test/failure_test.py b/test/failure_test.py index c2d068954..adc889b76 100644 --- a/test/failure_test.py +++ b/test/failure_test.py @@ -6,34 +6,6 @@ import test_functions class FailureTest(unittest.TestCase): - def testNoArgs(self): - reload(test_functions) - ray.init(start_ray_local=True, num_workers=1, driver_mode=ray.SILENT_MODE) - - test_functions.no_op_fail.remote() - time.sleep(0.2) - task_info = ray.task_info() - self.assertEqual(len(task_info["failed_tasks"]), 1) - self.assertEqual(len(task_info["running_tasks"]), 0) - self.assertTrue("The @remote decorator for function test_functions.no_op_fail has 0 return values, but test_functions.no_op_fail returned more than 0 values." in task_info["failed_tasks"][0].get("error_message")) - - ray.worker.cleanup() - - def testTypeChecking(self): - reload(test_functions) - ray.init(start_ray_local=True, num_workers=1, driver_mode=ray.SILENT_MODE) - - # Make sure that these functions throw exceptions because there return - # values do not type check. - test_functions.test_return1.remote() - test_functions.test_return2.remote() - time.sleep(0.2) - task_info = ray.task_info() - self.assertEqual(len(task_info["failed_tasks"]), 2) - self.assertEqual(len(task_info["running_tasks"]), 0) - - ray.worker.cleanup() - def testUnknownSerialization(self): reload(test_functions) ray.init(start_ray_local=True, num_workers=1, driver_mode=ray.SILENT_MODE) @@ -104,7 +76,7 @@ class TaskStatusTest(unittest.TestCase): return reducer, () def __call__(self): return - ray.remote([], [])(Foo()) + ray.remote()(Foo()) for _ in range(100): # Retry if we need to wait longer. if len(ray.task_info()["failed_remote_function_imports"]) >= 1: break diff --git a/test/test_functions.py b/test/test_functions.py index cc0a75c7a..d6be66ec6 100644 --- a/test/test_functions.py +++ b/test/test_functions.py @@ -103,20 +103,6 @@ def python_mode_g(x): def no_op(): pass -@ray.remote() -def no_op_fail(): - return 0 - -# test wrong return types - -@ray.remote() -def test_return1(): - return 0.0 - -@ray.remote(num_return_vals=2) -def test_return2(): - return 2.0, 3.0 - class TestClass(object): def __init__(self): self.a = 5