Register Common.error with local scheduler extension module. (#1316)

* Register Common.error with local scheduler extension module.

* Add test.
This commit is contained in:
Robert Nishihara
2017-12-13 11:55:54 -08:00
committed by Philipp Moritz
parent b6a35e0395
commit f75b51d178
3 changed files with 24 additions and 6 deletions
+18
View File
@@ -284,6 +284,24 @@ class SerializationTest(unittest.TestCase):
ray.worker.cleanup()
def testPuttingObjectThatClosesOverObjectID(self):
# This test is here to prevent a regression of
# https://github.com/ray-project/ray/issues/1317.
ray.init(num_workers=0)
class Foo(object):
def __init__(self):
self.val = ray.put(0)
def method(self):
f
f = Foo()
with self.assertRaises(ray.local_scheduler.common_error):
ray.put(f)
ray.worker.cleanup()
class WorkerTest(unittest.TestCase):
def testPythonWorkers(self):