diff --git a/src/aleph/vm/guest_api/__main__.py b/src/aleph/vm/guest_api/__main__.py index b1df069fc..1d35997dd 100644 --- a/src/aleph/vm/guest_api/__main__.py +++ b/src/aleph/vm/guest_api/__main__.py @@ -1,6 +1,7 @@ import json import logging import re +from pathlib import Path from typing import Optional import aiohttp @@ -152,7 +153,7 @@ async def list_keys_from_cache(request: web.Request): def run_guest_api( - unix_socket_path, + unix_socket_path: Path, vm_hash: Optional[str] = None, sentry_dsn: Optional[str] = None, server_name: Optional[str] = None, @@ -195,8 +196,8 @@ def run_guest_api( app.router.add_route(method="POST", path="/api/v0/p2p/pubsub/pub", handler=repost) # web.run_app(app=app, port=9000) - web.run_app(app=app, path=unix_socket_path) + web.run_app(app=app, path=str(unix_socket_path)) if __name__ == "__main__": - run_guest_api("/tmp/guest-api", vm_hash="vm") + run_guest_api(Path("/tmp/guest-api"), vm_hash="vm") diff --git a/tests/supervisor/test_execution.py b/tests/supervisor/test_execution.py index 902daa195..dba816bed 100644 --- a/tests/supervisor/test_execution.py +++ b/tests/supervisor/test_execution.py @@ -1,4 +1,5 @@ import asyncio +import logging import pytest from aleph_message.models import ItemHash @@ -20,8 +21,8 @@ async def test_create_execution(): settings.ALLOW_VM_NETWORKING = False settings.USE_JAILER = False - import logging logging.basicConfig(level=logging.DEBUG) + settings.PRINT_SYSTEM_LOGS = True # Ensure that the settings are correct and required files present. settings.setup() @@ -52,4 +53,5 @@ async def test_create_execution(): assert isinstance(vm, AlephFirecrackerProgram) assert vm.vm_id == 3 - await asyncio.wait_for(execution.start(), timeout=30) + await execution.start() + await execution.stop()