Skip to content

Commit 40cf447

Browse files
committed
fixed tests and errors, corrected metrics calculation a little
1 parent 1dbc1d9 commit 40cf447

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

backend/app/main.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import asyncio
2+
import contextlib
23
from contextlib import asynccontextmanager
34
from typing import AsyncGenerator
45

@@ -65,10 +66,9 @@ async def lifespan(app: FastAPI) -> AsyncGenerator[None, None]:
6566
task = app.state.daemonset_task
6667
if not task.done():
6768
task.cancel()
68-
try:
69+
with contextlib.suppress(asyncio.CancelledError):
6970
await task
70-
except asyncio.CancelledError:
71-
logger.info("Image pre-puller daemonset task cancelled successfully.")
71+
logger.info("Image pre-puller daemonset task cancelled successfully.")
7272

7373
if hasattr(app.state, "k8s_manager") and app.state.k8s_manager:
7474
await app.state.k8s_manager.shutdown_all()

backend/app/services/execution_service.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ async def execute_script(
212212
execution_id_str=inserted_oid, script=script,
213213
lang=lang, lang_version=lang_version
214214
)
215-
SCRIPT_EXECUTIONS.labels(status="initiated", lang_and_version=lang + "-" + lang_version).inc()
216215
await asyncio.sleep(0.1)
217216

218217
final_execution_state = await self.execution_repo.get_execution(inserted_oid)

backend/tests/integration/test_execution_api.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ async def test_execute_script_with_error(self) -> None:
120120
# 3. Assert Final Result indicates failure
121121
assert final_status == "error", f"Expected status 'error', got '{final_status}'"
122122
assert result_data is not None
123-
assert "Start" in result_data.get("errors", "")
123+
assert "Start" in result_data.get("output", "")
124124
assert "End" not in result_data.get("output", "")
125125
assert result_data.get("errors") is not None
126126
assert "Script failed with exit code 1" in result_data["errors"]

0 commit comments

Comments
 (0)