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
+4 -6
View File
@@ -16,6 +16,8 @@ if sys.version_info >= (3, 0):
class RemoteArrayTest(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()
def testMethods(self):
for module in [ra.core, ra.random, ra.linalg, da.core, da.random,
@@ -48,10 +50,10 @@ class RemoteArrayTest(unittest.TestCase):
r_val = ray.get(r_id)
assert_almost_equal(np.dot(q_val, r_val), a_val)
ray.worker.cleanup()
class DistributedArrayTest(unittest.TestCase):
def tearDown(self):
ray.worker.cleanup()
def testAssemble(self):
for module in [ra.core, ra.random, ra.linalg, da.core, da.random,
@@ -67,8 +69,6 @@ class DistributedArrayTest(unittest.TestCase):
np.vstack([np.ones([da.BLOCK_SIZE, da.BLOCK_SIZE]),
np.zeros([da.BLOCK_SIZE, da.BLOCK_SIZE])]))
ray.worker.cleanup()
def testMethods(self):
for module in [ra.core, ra.random, ra.linalg, da.core, da.random,
da.linalg]:
@@ -230,8 +230,6 @@ class DistributedArrayTest(unittest.TestCase):
d2 = np.random.randint(1, 35)
test_dist_qr(d1, d2)
ray.worker.cleanup()
if __name__ == "__main__":
unittest.main(verbosity=2)