mirror of
https://github.com/wassname/ray.git
synced 2026-07-01 03:08:48 +08:00
Remove task context from python worker (#5987)
Removes duplicated state between the python and C++ workers. Also cleans up the serialization codepaths a bit.
This commit is contained in:
@@ -8,7 +8,6 @@ import subprocess
|
||||
import time
|
||||
|
||||
import ray
|
||||
from ray.utils import _random_string
|
||||
from ray.tests.utils import (
|
||||
RayTestTimeoutException,
|
||||
run_string_as_driver,
|
||||
@@ -556,14 +555,12 @@ print("success")
|
||||
# Create some drivers and let them exit and make sure everything is
|
||||
# still alive.
|
||||
for _ in range(3):
|
||||
nonexistent_id_bytes = _random_string()
|
||||
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
|
||||
nonexistent_id = ray.ObjectID.from_random()
|
||||
driver_script = driver_script_template.format(address,
|
||||
nonexistent_id_hex)
|
||||
nonexistent_id.hex())
|
||||
out = run_string_as_driver(driver_script)
|
||||
# Simulate the nonexistent dependency becoming available.
|
||||
ray.worker.global_worker.put_object(
|
||||
ray.ObjectID(nonexistent_id_bytes), None)
|
||||
ray.worker.global_worker.put_object(None, nonexistent_id)
|
||||
# Make sure the first driver ran to completion.
|
||||
assert "success" in out
|
||||
|
||||
@@ -583,14 +580,12 @@ print("success")
|
||||
# Create some drivers and let them exit and make sure everything is
|
||||
# still alive.
|
||||
for _ in range(3):
|
||||
nonexistent_id_bytes = _random_string()
|
||||
nonexistent_id_hex = ray.utils.binary_to_hex(nonexistent_id_bytes)
|
||||
nonexistent_id = ray.ObjectID.from_random()
|
||||
driver_script = driver_script_template.format(address,
|
||||
nonexistent_id_hex)
|
||||
nonexistent_id.hex())
|
||||
out = run_string_as_driver(driver_script)
|
||||
# Simulate the nonexistent dependency becoming available.
|
||||
ray.worker.global_worker.put_object(
|
||||
ray.ObjectID(nonexistent_id_bytes), None)
|
||||
ray.worker.global_worker.put_object(None, nonexistent_id)
|
||||
# Make sure the first driver ran to completion.
|
||||
assert "success" in out
|
||||
|
||||
|
||||
Reference in New Issue
Block a user