poc #3107
380 tests run, 373 passed, 0 skipped, 7 failed.
Annotations
Check failure on line 137 in truss/tests/templates/control/control/test_server.py
github-actions / JUnit Test Report
test_server.test_patch_model_code_update_predict_on_long_load_time[asyncio+uvloop]
assert "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." == {'prediction': [1]}
+ where "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." = <bound method Response.json of <Response [503 Service Unavailable]>>()
+ where <bound method Response.json of <Response [503 Service Unavailable]>> = <Response [503 Service Unavailable]>.json
Raw output
app = <fastapi.applications.FastAPI object at 0x7fd7e3a74b80>
client = <httpx.AsyncClient object at 0x7fd7e3ab2df0>
@pytest.mark.anyio
async def test_patch_model_code_update_predict_on_long_load_time(app, client):
mock_model_file_content = """
class Model:
def load(self):
import time
time.sleep(3)
def predict(self, request):
return {'prediction': [1]}
"""
patch = Patch(
type=PatchType.MODEL_CODE,
body=ModelCodePatch(
action=Action.UPDATE,
path="model.py",
content=mock_model_file_content,
),
)
await _verify_apply_patch_success(client, patch)
resp = await client.post("/v1/models/model:predict", json={})
resp.status_code == 200
> assert resp.json() == {"prediction": [1]}
E assert "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." == {'prediction': [1]}
E + where "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." = <bound method Response.json of <Response [503 Service Unavailable]>>()
E + where <bound method Response.json of <Response [503 Service Unavailable]>> = <Response [503 Service Unavailable]>.json
truss/tests/templates/control/control/test_server.py:137: AssertionError
Check failure on line 137 in truss/tests/templates/control/control/test_server.py
github-actions / JUnit Test Report
test_server.test_patch_model_code_update_predict_on_long_load_time[asyncio]
assert "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." == {'prediction': [1]}
+ where "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." = <bound method Response.json of <Response [503 Service Unavailable]>>()
+ where <bound method Response.json of <Response [503 Service Unavailable]>> = <Response [503 Service Unavailable]>.json
Raw output
app = <fastapi.applications.FastAPI object at 0x7fd7e053ad00>
client = <httpx.AsyncClient object at 0x7fd7e3ab6a30>
@pytest.mark.anyio
async def test_patch_model_code_update_predict_on_long_load_time(app, client):
mock_model_file_content = """
class Model:
def load(self):
import time
time.sleep(3)
def predict(self, request):
return {'prediction': [1]}
"""
patch = Patch(
type=PatchType.MODEL_CODE,
body=ModelCodePatch(
action=Action.UPDATE,
path="model.py",
content=mock_model_file_content,
),
)
await _verify_apply_patch_success(client, patch)
resp = await client.post("/v1/models/model:predict", json={})
resp.status_code == 200
> assert resp.json() == {"prediction": [1]}
E assert "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." == {'prediction': [1]}
E + where "It appears your model has stopped running. This often means' ' it crashed and may need a fix to get it running again." = <bound method Response.json of <Response [503 Service Unavailable]>>()
E + where <bound method Response.json of <Response [503 Service Unavailable]>> = <Response [503 Service Unavailable]>.json
truss/tests/templates/control/control/test_server.py:137: AssertionError
Check failure on line 2 in truss/tests/templates/server/test_model_wrapper.py
github-actions / JUnit Test Report
test_model_wrapper.test_model_wrapper_load_error_once
ModuleNotFoundError: No module named 'aiofiles'
Raw output
app_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_model_wrapper_load_error_0/truss_fs/app')
@pytest.mark.anyio
async def test_model_wrapper_load_error_once(app_path):
if "model_wrapper" in sys.modules:
model_wrapper_module = sys.modules["model_wrapper"]
importlib.reload(model_wrapper_module)
else:
> model_wrapper_module = importlib.import_module("model_wrapper")
truss/tests/templates/server/test_model_wrapper.py:50:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
<frozen importlib._bootstrap_external>:850: in exec_module
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import asyncio
> import aiofiles
E ModuleNotFoundError: No module named 'aiofiles'
/tmp/pytest-of-runner/pytest-0/test_model_wrapper_load_error_0/truss_fs/app/model_wrapper.py:2: ModuleNotFoundError
Check failure on line 2 in truss/tests/templates/server/test_model_wrapper.py
github-actions / JUnit Test Report
test_model_wrapper.test_model_wrapper_load_error_more_than_allowed
ModuleNotFoundError: No module named 'aiofiles'
Raw output
app_path = PosixPath('/tmp/pytest-of-runner/pytest-0/test_model_wrapper_load_error_1/truss_fs/app')
helpers = <truss.tests.conftest.Helpers object at 0x7fd7e01acc10>
def test_model_wrapper_load_error_more_than_allowed(app_path, helpers):
with helpers.env_var("NUM_LOAD_RETRIES_TRUSS", "0"):
if "model_wrapper" in sys.modules:
model_wrapper_module = sys.modules["model_wrapper"]
importlib.reload(model_wrapper_module)
else:
> model_wrapper_module = importlib.import_module("model_wrapper")
truss/tests/templates/server/test_model_wrapper.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
<frozen importlib._bootstrap_external>:850: in exec_module
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import asyncio
> import aiofiles
E ModuleNotFoundError: No module named 'aiofiles'
/tmp/pytest-of-runner/pytest-0/test_model_wrapper_load_error_1/truss_fs/app/model_wrapper.py:2: ModuleNotFoundError
Check failure on line 103 in truss/tests/templates/server/test_model_wrapper.py
github-actions / JUnit Test Report
test_model_wrapper.test_trt_llm_truss_init_extension
ModuleNotFoundError: No module named 'aiofiles'
Raw output
trt_llm_truss_container_fs = PosixPath('/tmp/pytest-of-runner/pytest-0/test_trt_llm_truss_init_extens0/truss_fs')
helpers = <truss.tests.conftest.Helpers object at 0x7fd7ea5149d0>
@pytest.mark.anyio
async def test_trt_llm_truss_init_extension(trt_llm_truss_container_fs, helpers):
app_path = trt_llm_truss_container_fs / "app"
packages_path = trt_llm_truss_container_fs / "packages"
with _clear_model_load_modules(), helpers.sys_paths(app_path, packages_path):
> model_wrapper_module = importlib.import_module("model_wrapper")
truss/tests/templates/server/test_model_wrapper.py:103:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
<frozen importlib._bootstrap_external>:850: in exec_module
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import asyncio
> import aiofiles
E ModuleNotFoundError: No module named 'aiofiles'
/tmp/pytest-of-runner/pytest-0/test_trt_llm_truss_init_extens0/truss_fs/app/model_wrapper.py:2: ModuleNotFoundError
Check failure on line 129 in truss/tests/templates/server/test_model_wrapper.py
github-actions / JUnit Test Report
test_model_wrapper.test_trt_llm_truss_predict
ModuleNotFoundError: No module named 'aiofiles'
Raw output
trt_llm_truss_container_fs = PosixPath('/tmp/pytest-of-runner/pytest-0/test_trt_llm_truss_predict0/truss_fs')
helpers = <truss.tests.conftest.Helpers object at 0x7fd7e3a1d2e0>
@pytest.mark.anyio
async def test_trt_llm_truss_predict(trt_llm_truss_container_fs, helpers):
app_path = trt_llm_truss_container_fs / "app"
packages_path = trt_llm_truss_container_fs / "packages"
with _clear_model_load_modules(), helpers.sys_paths(
app_path, packages_path
), _change_directory(app_path):
> model_wrapper_module = importlib.import_module("model_wrapper")
truss/tests/templates/server/test_model_wrapper.py:129:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
<frozen importlib._bootstrap_external>:850: in exec_module
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import asyncio
> import aiofiles
E ModuleNotFoundError: No module named 'aiofiles'
/tmp/pytest-of-runner/pytest-0/test_trt_llm_truss_predict0/truss_fs/app/model_wrapper.py:2: ModuleNotFoundError
Check failure on line 166 in truss/tests/templates/server/test_model_wrapper.py
github-actions / JUnit Test Report
test_model_wrapper.test_trt_llm_truss_missing_model_py
ModuleNotFoundError: No module named 'aiofiles'
Raw output
trt_llm_truss_container_fs = PosixPath('/tmp/pytest-of-runner/pytest-0/test_trt_llm_truss_missing_mod0/truss_fs')
helpers = <truss.tests.conftest.Helpers object at 0x7fd7e4f1d8e0>
@pytest.mark.anyio
async def test_trt_llm_truss_missing_model_py(trt_llm_truss_container_fs, helpers):
app_path = trt_llm_truss_container_fs / "app"
(app_path / "model" / "model.py").unlink()
packages_path = trt_llm_truss_container_fs / "packages"
with _clear_model_load_modules(), helpers.sys_paths(
app_path, packages_path
), _change_directory(app_path):
> model_wrapper_module = importlib.import_module("model_wrapper")
truss/tests/templates/server/test_model_wrapper.py:166:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/hostedtoolcache/Python/3.9.9/x64/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
<frozen importlib._bootstrap_external>:850: in exec_module
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
import asyncio
> import aiofiles
E ModuleNotFoundError: No module named 'aiofiles'
/tmp/pytest-of-runner/pytest-0/test_trt_llm_truss_missing_mod0/truss_fs/app/model_wrapper.py:2: ModuleNotFoundError