Skip to content

Commit d6fe5ea

Browse files
committed
asyncio saving task fix 2
1 parent df1e281 commit d6fe5ea

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

backend/tests/unit/services/test_execution_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,12 +395,12 @@ async def test_start_k8s_execution_success(self,
395395

396396
mock_k8s_service.create_execution_pod = AsyncMock()
397397

398-
with patch('asyncio.create_task') as mock_create_task:
399-
mock_create_task.return_value = AsyncMock()
398+
with patch.object(execution_service, '_mark_running_when_scheduled') as mock_mark_running:
399+
mock_mark_running.return_value = AsyncMock()
400400
await execution_service._start_k8s_execution(execution_id, script, lang, lang_version)
401401

402402
mock_k8s_service.create_execution_pod.assert_called_once()
403-
mock_create_task.assert_called_once()
403+
mock_mark_running.assert_called_once()
404404

405405
@pytest.mark.asyncio
406406
@patch('app.services.execution_service.RUNTIME_REGISTRY')

0 commit comments

Comments
 (0)