Changed smoke-test to wait AI conversion
ci/woodpecker/manual/e2e-smoke-jetson Pipeline was canceled

This commit is contained in:
Roman Meshko
2026-04-26 23:42:09 +03:00
parent 73c9d57827
commit c7d5d11f6a
2 changed files with 39 additions and 2 deletions
+31 -1
View File
@@ -1,4 +1,5 @@
import json
import os
import threading
import time
import uuid
@@ -7,6 +8,13 @@ import pytest
import sseclient
_DETECT_TIMEOUT = 60
_ENGINE_WAIT_TIMEOUT = int(os.environ.get("E2E_ENGINE_WAIT_TIMEOUT", "900"))
_WAIT_FOR_ENGINE_ENABLED = os.environ.get("E2E_WAIT_FOR_ENGINE_ENABLED", "").lower() in (
"1",
"true",
"yes",
"on",
)
def _get_health(http_client):
@@ -20,6 +28,24 @@ def _assert_active_ai(data):
assert data["aiAvailability"] not in ("None", "Downloading")
def _wait_for_engine_enabled(http_client):
deadline = time.time() + _ENGINE_WAIT_TIMEOUT
last = None
while time.time() < deadline:
last = _get_health(http_client)
availability = last.get("aiAvailability")
if availability == "Enabled":
assert last.get("errorMessage") is None
return last
if availability == "Error":
pytest.fail(f"engine conversion failed: {last.get('errorMessage')}")
time.sleep(3)
pytest.fail(
f"engine did not become Enabled within {_ENGINE_WAIT_TIMEOUT}s "
f"(last health: {last})"
)
@pytest.mark.cpu
class TestHealthEngineStep01PreInit:
def test_ft_p_01_pre_init_health(self, http_client):
@@ -92,8 +118,12 @@ class TestHealthEngineStep03Warmed:
def _warm(self, warm_engine):
pass
@pytest.mark.timeout(_ENGINE_WAIT_TIMEOUT + 30)
def test_ft_p_02_post_init_health(self, http_client):
data = _get_health(http_client)
if _WAIT_FOR_ENGINE_ENABLED:
data = _wait_for_engine_enabled(http_client)
else:
data = _get_health(http_client)
_assert_active_ai(data)
assert data.get("errorMessage") is None