Introduce flag to use pickle for serialization (#5805)

This commit is contained in:
Philipp Moritz
2019-10-18 22:29:36 -07:00
committed by GitHub
parent 29eee7f970
commit d23696de17
9 changed files with 85 additions and 22 deletions
+20
View File
@@ -551,3 +551,23 @@ print("success")
# Make sure we can still talk with the raylet.
ray.get(f.remote())
@pytest.mark.parametrize(
"call_ray_start", ["ray start --head --num-cpus=1 --use-pickle"],
indirect=True)
def test_use_pickle(call_ray_start):
address = call_ray_start
ray.init(address=address, use_pickle=True)
assert ray.worker.global_worker.use_pickle
x = (2, "hello")
@ray.remote
def f(x):
assert x == (2, "hello")
assert ray.worker.global_worker.use_pickle
return (3, "world")
assert ray.get(f.remote(x)) == (3, "world")