diff --git a/src/lightning/app/plugin/plugin.py b/src/lightning/app/plugin/plugin.py index f3bacbc462..56a9a9fe19 100644 --- a/src/lightning/app/plugin/plugin.py +++ b/src/lightning/app/plugin/plugin.py @@ -201,8 +201,9 @@ async def _healthz() -> Dict[str, str]: return {"status": "ok"} -def _start_plugin_server(host: str, port: int) -> None: +def _start_plugin_server(port: int) -> None: """Start the plugin server which can be used to dispatch apps or run plugins.""" + fastapi_service = FastAPI() fastapi_service.add_middleware( @@ -216,4 +217,9 @@ def _start_plugin_server(host: str, port: int) -> None: fastapi_service.post("/v1/runs")(_run_plugin) fastapi_service.get("/healthz", status_code=200)(_healthz) - uvicorn.run(app=fastapi_service, host=host, port=port, log_level="error") + uvicorn.run( + app=fastapi_service, + host="127.0.0.1", + port=port, + log_level="error", + ) diff --git a/tests/tests_app/plugin/test_plugin.py b/tests/tests_app/plugin/test_plugin.py index 662b93cae4..a81acded8a 100644 --- a/tests/tests_app/plugin/test_plugin.py +++ b/tests/tests_app/plugin/test_plugin.py @@ -24,7 +24,7 @@ def mock_plugin_server(mock_uvicorn) -> TestClient: mock_uvicorn.run.side_effect = create_test_client - _start_plugin_server("0.0.0.0", 8888) # noqa: S104 + _start_plugin_server(8888) return test_client["client"]