Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[serve] __init__ functions have no return values #47144

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 6 additions & 9 deletions python/ray/serve/tests/test_constructor_failure.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,8 @@ def __init__(self):
else:
with open(file_path) as f:
content = f.read()
if content == serve.get_replica_context().replica_id.unique_id:
raise RuntimeError("Consistently throwing on same replica.")
else:
return True
if content == serve.get_replica_context().replica_id.unique_id:
raise RuntimeError("Consistently throwing on same replica.")

async def serve(self, request):
return "hi"
Expand All @@ -92,11 +90,10 @@ def test_deploy_with_transient_constructor_failure(serve_instance):
class TransientConstructorFailureDeployment:
def __init__(self):
if os.path.exists(file_path):
return True
else:
with open(file_path, "w") as f:
f.write("ONE")
raise RuntimeError("Intentionally throw on first try.")
return
with open(file_path, "w") as f:
f.write("ONE")
raise RuntimeError("Intentionally throw on first try.")

async def serve(self, request):
return "hi"
Expand Down
2 changes: 1 addition & 1 deletion python/ray/serve/tests/test_controller_recovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_recover_start_from_replica_actor_names(serve_instance, deployment_optio
)
class TransientConstructorFailureDeployment:
def __init__(self):
return True
pass

def __call__(self, *args):
return "hii"
Expand Down