From e3de8bb625dad429ad59ae1a43037d7e20548f3d Mon Sep 17 00:00:00 2001 From: Edward Oakes Date: Fri, 23 Jun 2023 11:07:28 -0500 Subject: [PATCH] [minor] Remove unreachable lines of code (#36599) Signed-off-by: e428265 --- python/ray/actor.py | 1 - python/ray/serve/tests/test_standalone3.py | 5 +++++ python/ray/serve/tests/test_streaming_response.py | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/python/ray/actor.py b/python/ray/actor.py index c9a060031512..8bc6570e23a9 100644 --- a/python/ray/actor.py +++ b/python/ray/actor.py @@ -1405,7 +1405,6 @@ def exit_actor(): exit.is_ray_terminate = True exit.ray_terminate_msg = "exit_actor() is called." raise exit - assert False, "This process should have terminated." else: raise TypeError( "exit_actor API is called on a non-actor worker, " diff --git a/python/ray/serve/tests/test_standalone3.py b/python/ray/serve/tests/test_standalone3.py index 116ca6236f6b..b55c7d3eba96 100644 --- a/python/ray/serve/tests/test_standalone3.py +++ b/python/ray/serve/tests/test_standalone3.py @@ -20,6 +20,7 @@ from ray.cluster_utils import AutoscalingCluster from ray.exceptions import RayActorError from ray.serve._private.constants import ( + RAY_SERVE_ENABLE_EXPERIMENTAL_STREAMING, SYNC_HANDLE_IN_DAG_FEATURE_FLAG_ENV_KEY, SERVE_DEFAULT_APP_NAME, ) @@ -161,6 +162,10 @@ async def f(): indirect=True, ) @pytest.mark.parametrize("crash", [True, False]) +@pytest.mark.skipif( + RAY_SERVE_ENABLE_EXPERIMENTAL_STREAMING, + reason="No retries w/ new behavior.", +) def test_http_request_number_of_retries(ray_instance, crash): """Test HTTP proxy retry requests.""" diff --git a/python/ray/serve/tests/test_streaming_response.py b/python/ray/serve/tests/test_streaming_response.py index fdc46b779e88..f443c4b40324 100644 --- a/python/ray/serve/tests/test_streaming_response.py +++ b/python/ray/serve/tests/test_streaming_response.py @@ -217,12 +217,10 @@ def test_exception_in_generator(serve_instance, use_async: bool, use_fastapi: bo async def hi_gen_async(): yield "first result" raise Exception("raised in generator") - yield "never reached" def hi_gen_sync(): yield "first result" raise Exception("raised in generator") - yield "never reached" if use_fastapi: app = FastAPI()