From 5945cfcd5d9cee38519341a9dfe502a54099c61f Mon Sep 17 00:00:00 2001 From: Chi-Sheng Liu Date: Wed, 5 Mar 2025 02:14:49 +0800 Subject: [PATCH] Fix wrong check Closes: ray-project/ray#49451 Signed-off-by: Chi-Sheng Liu --- python/ray/tests/test_actor_failures.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python/ray/tests/test_actor_failures.py b/python/ray/tests/test_actor_failures.py index aa1f93ad66040..c96ac610bb2c0 100644 --- a/python/ray/tests/test_actor_failures.py +++ b/python/ray/tests/test_actor_failures.py @@ -994,8 +994,14 @@ async def exit(self): a = AsyncActor.remote() ray.get(a.__ray_ready__.remote()) - with pytest.raises(ray.exceptions.RayActorError): + with pytest.raises(ray.exceptions.RayActorError) as exc_info: ray.get(a.exit.remote()) + assert ( + # Exited when task execution returns + "exit_actor()" in str(exc_info.value) + # Exited during periodical check in worker + or "User requested to exit the actor" in str(exc_info.value) + ) def verify(): return temp_file_atexit.exists() @@ -1024,14 +1030,8 @@ async def create(self): a = AsyncActor.remote() ray.get(a.__ray_ready__.remote()) - with pytest.raises(ray.exceptions.RayActorError) as exc_info: + with pytest.raises(ray.exceptions.RayActorError): ray.get(a.exit.remote()) - assert ( - # Exited when task execution returns - "exit_actor()" in str(exc_info.value) - # Exited during periodical check in worker - or "User requested to exit the actor" in str(exc_info.value) - ) with pytest.raises(ray.exceptions.RayActorError): ray.get(a.create.remote())