From fbf93479eb4bf2cf86388e188b7313a55b4a14d5 Mon Sep 17 00:00:00 2001 From: Sudeep Pillai Date: Wed, 8 Nov 2023 12:31:09 -0800 Subject: [PATCH] Fixes for client/server tests with `rc3` release (#465) ## Summary ## Related issues ## Checks - [ ] `make lint`: I've run `make lint` to lint the changes in this PR. - [ ] `make test`: I've made sure the tests (`make test-cpu` or `make test`) are passing. - Additional tests: - [ ] Benchmark tests (when contributing new models) - [ ] GPU/HW tests --- nos/test/conftest.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nos/test/conftest.py b/nos/test/conftest.py index 6704cbd3..94fadc99 100644 --- a/nos/test/conftest.py +++ b/nos/test/conftest.py @@ -220,10 +220,10 @@ def local_http_client_with_server(grpc_server): # noqa: F811 """Test local HTTP client with local runtime.""" from fastapi.testclient import TestClient - from nos.server.http._service import app + from nos.server.http._service import app_factory # Yield the HTTP client once the server is up and initialized - with TestClient(app(grpc_port=GRPC_TEST_PORT)) as _client: + with TestClient(app_factory(address=f"[::]:{GRPC_TEST_PORT}")) as _client: yield _client @@ -237,10 +237,10 @@ def http_client_with_cpu_backend(grpc_server_docker_runtime_cpu): # noqa: F811 """Test HTTP client with initialized CPU docker runtime (Port: 50053).""" from fastapi.testclient import TestClient - from nos.server.http._service import app + from nos.server.http._service import app_factory # Yield the HTTP client once the server is up and initialized - with TestClient(app(grpc_port=GRPC_TEST_PORT_CPU)) as _client: + with TestClient(app_factory(address=f"[::]:{GRPC_TEST_PORT_CPU}")) as _client: yield _client @@ -254,10 +254,10 @@ def http_client_with_gpu_backend(grpc_server_docker_runtime_gpu): # noqa: F811 """Test HTTP client with initialized CPU docker runtime (Port: 50054).""" from fastapi.testclient import TestClient - from nos.server.http._service import app + from nos.server.http._service import app_factory # Yield the HTTP client once the server is up and initialized - with TestClient(app(grpc_port=GRPC_TEST_PORT_GPU)) as _client: + with TestClient(app_factory(address=f"[::]:{GRPC_TEST_PORT_GPU}")) as _client: yield _client