mirror of
https://github.com/wassname/ray.git
synced 2026-06-29 04:44:28 +08:00
Support metadata for passing by value task arguments (#5527)
This commit is contained in:
@@ -3,9 +3,9 @@ package org.ray.api.test;
|
||||
import org.ray.api.Ray;
|
||||
import org.ray.api.RayPyActor;
|
||||
import org.ray.api.TestUtils;
|
||||
import org.ray.api.id.ObjectId;
|
||||
import org.ray.runtime.context.WorkerContext;
|
||||
import org.ray.runtime.object.NativeRayObject;
|
||||
import org.ray.runtime.object.ObjectStore;
|
||||
import org.ray.runtime.object.ObjectSerializer;
|
||||
import org.testng.Assert;
|
||||
import org.testng.annotations.Test;
|
||||
|
||||
@@ -14,10 +14,10 @@ public class RaySerializerTest extends BaseMultiLanguageTest {
|
||||
@Test
|
||||
public void testSerializePyActor() {
|
||||
RayPyActor pyActor = Ray.createPyActor("test", "RaySerializerTest");
|
||||
ObjectStore objectStore = TestUtils.getRuntime().getObjectStore();
|
||||
NativeRayObject nativeRayObject = objectStore.serialize(pyActor);
|
||||
RayPyActor result = (RayPyActor) objectStore
|
||||
.deserialize(nativeRayObject, ObjectId.fromRandom());
|
||||
WorkerContext workerContext = TestUtils.getRuntime().getWorkerContext();
|
||||
NativeRayObject nativeRayObject = ObjectSerializer.serialize(pyActor);
|
||||
RayPyActor result = (RayPyActor) ObjectSerializer
|
||||
.deserialize(nativeRayObject, null, workerContext.getCurrentClassLoader());
|
||||
Assert.assertEquals(result.getId(), pyActor.getId());
|
||||
Assert.assertEquals(result.getModuleName(), "test");
|
||||
Assert.assertEquals(result.getClassName(), "RaySerializerTest");
|
||||
|
||||
Reference in New Issue
Block a user