Move calls to ray.worker.cleanup into tearDown part of tests for isolation. (#1433)

This commit is contained in:
Robert Nishihara
2018-01-22 22:54:56 -08:00
committed by Philipp Moritz
parent 4b1c8be4fe
commit f32c0c8ec1
5 changed files with 37 additions and 91 deletions
+2 -4
View File
@@ -16,6 +16,8 @@ if sys.version_info >= (3, 0):
class MicroBenchmarkTest(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()
def testTiming(self):
reload(test_functions)
@@ -89,8 +91,6 @@ class MicroBenchmarkTest(unittest.TestCase):
print(" worst: {}".format(elapsed_times[999]))
# average_elapsed_time should be about 0.00087.
ray.worker.cleanup()
def testCache(self):
ray.init(num_workers=1)
@@ -115,8 +115,6 @@ class MicroBenchmarkTest(unittest.TestCase):
print("WARNING: The caching test was too slow. "
"d = {}, b = {}".format(d, b))
ray.worker.cleanup()
if __name__ == "__main__":
unittest.main(verbosity=2)