Skip to content

Commit

Permalink
test: fix runtime error in python<3.12 (#388)
Browse files Browse the repository at this point in the history
* test: fix runtime error in python<3.12

* cleaner approach

* forgot
  • Loading branch information
masci authored Nov 29, 2024
1 parent d396260 commit 340df58
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions tests/services/test_workflow_service.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
import asyncio
import json
import pytest
from pydantic import PrivateAttr
from typing import Any, List
from llama_index.core.workflow import Workflow, StartEvent, StopEvent, step
from llama_index.core.workflow.events import HumanResponseEvent, InputRequiredEvent

import pytest
from llama_index.core.workflow import StartEvent, StopEvent, Workflow, step
from llama_index.core.workflow.context_serializers import JsonSerializer
from llama_index.core.workflow.events import HumanResponseEvent, InputRequiredEvent
from pydantic import PrivateAttr

from llama_deploy.messages import QueueMessage
from llama_deploy.message_consumers import BaseMessageQueueConsumer
from llama_deploy.message_queues import SimpleMessageQueue
from llama_deploy.messages import QueueMessage
from llama_deploy.services.workflow import WorkflowService
from llama_deploy.types import CONTROL_PLANE_NAME, ActionTypes, TaskDefinition

Expand Down Expand Up @@ -100,6 +101,9 @@ async def test_workflow_service(
assert result.action == ActionTypes.COMPLETED_TASK
assert result.data["result"] == "test_arg1_result"

# allow a clean shutdown
await asyncio.gather(mq_task, server_task, return_exceptions=True)


@pytest.mark.asyncio()
async def test_hitl_workflow_service(
Expand Down Expand Up @@ -162,3 +166,6 @@ async def test_hitl_workflow_service(
result = human_output_consumer.processed_messages[-1]
assert result.action == ActionTypes.COMPLETED_TASK
assert result.data["result"] == "42"

# allow a clean shutdown
await asyncio.gather(mq_task, server_task, return_exceptions=True)

0 comments on commit 340df58

Please sign in to comment.