Skip to content

Commit

Permalink
Increase httpx timeouts
Browse files Browse the repository at this point in the history
  • Loading branch information
jmsmkn committed Dec 8, 2023
1 parent 7cb3ca4 commit 019144d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def minio_container():
)

# Wait for startup
sleep(5)
sleep(1)

mpatch = pytest.MonkeyPatch()

Expand Down
12 changes: 8 additions & 4 deletions tests/test_container_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ def container():
sys.platform != "linux", reason="does not run outside linux"
)
def test_container_responds_to_ping():
response = httpx.get("http://localhost:8080/ping")
response = httpx.get("http://localhost:8080/ping", timeout=30)

# SageMaker waits for an HTTP 200 status code and an empty body
# for a successful ping request before sending an invocations request.
Expand All @@ -130,7 +130,9 @@ def test_container_responds_to_ping():
sys.platform != "linux", reason="does not run outside linux"
)
def test_container_responds_to_execution_parameters():
response = httpx.get("http://localhost:8080/execution-parameters")
response = httpx.get(
"http://localhost:8080/execution-parameters", timeout=30
)

assert response.json() == {
"MaxConcurrentTransforms": 1,
Expand All @@ -154,7 +156,9 @@ def test_invocations_endpoint(minio):
"output_bucket_name": minio.output_bucket_name,
"output_prefix": f"test/{pk}",
}
response = httpx.post("http://localhost:8080/invocations", json=data)
response = httpx.post(
"http://localhost:8080/invocations", json=data, timeout=30
)

# To obtain inferences, Amazon SageMaker sends a POST request to the
# inference container. The POST request body contains data from
Expand Down Expand Up @@ -188,7 +192,7 @@ def test_alpine_image(minio):
"output_prefix": f"test/{pk}",
}
response = httpx.post(
f"http://localhost:{host_port}/invocations", json=data
f"http://localhost:{host_port}/invocations", json=data, timeout=30
)

response = response.json()
Expand Down

0 comments on commit 019144d

Please sign in to comment.