mirror of
https://github.com/wassname/ray.git
synced 2026-07-21 12:50:45 +08:00
[api] Second round of 1.0 API changes: exceptions, num_return_vals (#10377)
This commit is contained in:
@@ -110,7 +110,7 @@ def test_reconstruction_cached_dependency(ray_start_cluster,
|
||||
else:
|
||||
with pytest.raises(ray.exceptions.RayTaskError) as e:
|
||||
ray.get(dependent_task.remote(obj))
|
||||
with pytest.raises(ray.exceptions.UnreconstructableError):
|
||||
with pytest.raises(ray.exceptions.ObjectLostError):
|
||||
raise e.as_instanceof_cause()
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ def test_basic_reconstruction(ray_start_cluster, reconstruction_enabled):
|
||||
else:
|
||||
with pytest.raises(ray.exceptions.RayTaskError) as e:
|
||||
ray.get(dependent_task.remote(obj))
|
||||
with pytest.raises(ray.exceptions.UnreconstructableError):
|
||||
with pytest.raises(ray.exceptions.ObjectLostError):
|
||||
raise e.as_instanceof_cause()
|
||||
|
||||
|
||||
@@ -215,7 +215,7 @@ def test_basic_reconstruction_put(ray_start_cluster, reconstruction_enabled):
|
||||
# been evicted.
|
||||
try:
|
||||
ray.get(result)
|
||||
except ray.exceptions.UnreconstructableError:
|
||||
except ray.exceptions.ObjectLostError:
|
||||
pass
|
||||
|
||||
|
||||
@@ -284,7 +284,7 @@ def test_basic_reconstruction_actor_task(ray_start_cluster,
|
||||
else:
|
||||
with pytest.raises(ray.exceptions.RayTaskError) as e:
|
||||
ray.get(dependent_task.remote(obj))
|
||||
with pytest.raises(ray.exceptions.UnreconstructableError):
|
||||
with pytest.raises(ray.exceptions.ObjectLostError):
|
||||
raise e.as_instanceof_cause()
|
||||
|
||||
# Make sure the actor handle is still usable.
|
||||
@@ -356,8 +356,7 @@ def test_basic_reconstruction_actor_constructor(ray_start_cluster,
|
||||
return True
|
||||
except ray.exceptions.RayActorError:
|
||||
return False
|
||||
except (ray.exceptions.RayTaskError,
|
||||
ray.exceptions.UnreconstructableError):
|
||||
except (ray.exceptions.RayTaskError, ray.exceptions.ObjectLostError):
|
||||
return True
|
||||
|
||||
wait_for_condition(probe)
|
||||
@@ -369,7 +368,7 @@ def test_basic_reconstruction_actor_constructor(ray_start_cluster,
|
||||
x = a.dependent_task.remote(obj)
|
||||
print(x)
|
||||
ray.get(x)
|
||||
with pytest.raises(ray.exceptions.UnreconstructableError):
|
||||
with pytest.raises(ray.exceptions.ObjectLostError):
|
||||
raise e.as_instanceof_cause()
|
||||
|
||||
|
||||
@@ -429,7 +428,7 @@ def test_multiple_downstream_tasks(ray_start_cluster, reconstruction_enabled):
|
||||
dependent_task.options(resources={
|
||||
"node1": 1
|
||||
}).remote(obj))
|
||||
with pytest.raises(ray.exceptions.UnreconstructableError):
|
||||
with pytest.raises(ray.exceptions.ObjectLostError):
|
||||
raise e.as_instanceof_cause()
|
||||
|
||||
|
||||
@@ -480,7 +479,7 @@ def test_reconstruction_chain(ray_start_cluster, reconstruction_enabled):
|
||||
else:
|
||||
with pytest.raises(ray.exceptions.RayTaskError) as e:
|
||||
ray.get(dependent_task.remote(obj))
|
||||
with pytest.raises(ray.exceptions.UnreconstructableError):
|
||||
with pytest.raises(ray.exceptions.ObjectLostError):
|
||||
raise e.as_instanceof_cause()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user