Skip to content

Commit

Permalink
fix: setup_environment integration test (#1196)
Browse files Browse the repository at this point in the history
* fix setup_env integration test

* standardize logging
  • Loading branch information
spal1 authored Oct 22, 2024
1 parent 5906d60 commit ea9aa46
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion truss/templates/server/model_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ async def setup_environment(self, environment: Optional[dict]):
if not descriptor:
return
self._logger.info(
f"Executing model.setup_environment with new environment: {environment}"
f"Executing model.setup_environment with environment: {environment}"
)
if descriptor.is_async:
return await self._model.setup_environment(environment)
Expand Down
10 changes: 5 additions & 5 deletions truss/tests/test_model_inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -792,11 +792,11 @@ def predict(self, model_input):
]
)
time.sleep(30)
single_quote_beta_env_str = beta_env_str.replace('"', "'")
assert (
f"Executing model.setup_environment with environment: {single_quote_beta_env_str}"
f"Executing model.setup_environment with environment: {beta_env}"
in container.logs()
)
single_quote_beta_env_str = beta_env_str.replace('"', "'")
assert (
f"setup_environment called with {single_quote_beta_env_str}"
in container.logs()
Expand Down Expand Up @@ -837,11 +837,11 @@ def predict(self, model_input):
wait_for_server_ready=True,
)
# Don't need to wait here because we explicitly grab the environment from dynamic_config_resolver before calling user's load()
single_quote_staging_env_str = staging_env_str.replace('"', "'")
assert (
f"Executing model.setup_environment with environment: {single_quote_staging_env_str}"
f"Executing model.setup_environment with environment: {staging_env}"
in container.logs()
)
single_quote_staging_env_str = staging_env_str.replace('"', "'")
assert (
f"setup_environment called with {single_quote_staging_env_str}"
in container.logs()
Expand All @@ -860,7 +860,7 @@ def predict(self, model_input):
)
time.sleep(30)
assert (
f"Executing model.setup_environment with new environment: {no_env}"
f"Executing model.setup_environment with environment: {no_env}"
in container.logs()
)
assert "setup_environment called with None" in container.logs()
Expand Down

0 comments on commit ea9aa46

Please sign in to comment.