mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 17:37:07 +08:00
Introduce flag to use pickle for serialization (#5805)
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user