Skip to content

Commit

Permalink
Try fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
marius-baseten committed Sep 19, 2024
1 parent 54eaa90 commit 5882451
Show file tree
Hide file tree
Showing 8 changed files with 444 additions and 426 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- uses: ./.github/actions/setup-python/
- run: poetry install
- name: run tests
run: poetry run pytest -v --cov=truss -m 'not integration' --junitxml=report.xml
run: poetry run pytest --durations=0 -m 'not integration' --junitxml=report.xml
- name: Publish Test Report # Not sure how to display this in the UI for non PRs.
uses: mikepenz/action-junit-report@v4
if: always()
Expand Down
858 changes: 437 additions & 421 deletions poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "truss"
version = "0.9.35"
version = "0.9.36rc01"
description = "A seamless bridge from model development to model delivery"
license = "MIT"
readme = "README.md"
Expand Down
1 change: 1 addition & 0 deletions truss/templates/control/control/endpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async def proxy(request: Request):
),
stop=stop_after_attempt(INFERENCE_SERVER_START_WAIT_SECS),
wait=wait_fixed(1),
reraise=True,
):
with attempt:
try:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def inference_server_startup_flow(
for attempt in Retrying(
stop=stop_after_attempt(15),
wait=wait_exponential(multiplier=2, min=1, max=4),
reraise=True,
):
with attempt:
try:
Expand Down
2 changes: 1 addition & 1 deletion truss/templates/server/model_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ async def _write_response_to_queue(
await queue.put(chunk)
except Exception as e:
self._logger.exception(
"Exception while reading stream response: " + str(e)
"Exception while generating streamed response: " + str(e)
)
finally:
await queue.put(SENTINEL)
Expand Down
2 changes: 1 addition & 1 deletion truss/tests/templates/server/test_model_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ async def test_model_wrapper_load_error_once(app_path):
model_wrapper = model_wrapper_class(config, sdk_trace.NoOpTracer())
model_wrapper.load()
# Allow load thread to execute
time.sleep(1)
time.sleep(2)
output = await model_wrapper.predict({}, MagicMock(spec=Request))
assert output == {}
assert model_wrapper._model.load_count == 2
Expand Down
2 changes: 1 addition & 1 deletion truss/tests/test_model_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ def test_streaming_with_error_and_stacktrace():
assert_logs_contain_error(
container.logs(),
error=expected_stack_trace,
message="Exception while reading stream response: Crashed in `bar`.",
message="Exception while generating streamed response: Crashed in `bar`.",
)


Expand Down

0 comments on commit 5882451

Please sign in to comment.