mirror of
https://github.com/wassname/ray.git
synced 2026-06-30 05:41:19 +08:00
Serialize StringIO with pickle (#5781)
This commit is contained in:
@@ -6,6 +6,7 @@ from __future__ import print_function
|
||||
import collections
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
import glob
|
||||
import io
|
||||
import json
|
||||
import logging
|
||||
from multiprocessing import Process
|
||||
@@ -304,6 +305,13 @@ def test_complex_serialization(ray_start_regular):
|
||||
assert_equal(obj, ray.get(f.remote(obj)))
|
||||
assert_equal(obj, ray.get(ray.put(obj)))
|
||||
|
||||
# Test StringIO serialization
|
||||
s = io.StringIO(u"Hello, world!\n")
|
||||
s.seek(0)
|
||||
line = s.readline()
|
||||
s.seek(0)
|
||||
assert ray.get(ray.put(s)).readline() == line
|
||||
|
||||
|
||||
def test_nested_functions(ray_start_regular):
|
||||
# Make sure that remote functions can use other values that are defined
|
||||
|
||||
Reference in New Issue
Block a user