feat: Raise exception in tests when blocking code is called in event loop (#4293)

Raise exception in tests when blocking code is called in event loop
This commit is contained in:
Christophe Bornet 2024-11-02 17:03:31 +01:00 • committed by GitHub
commit 14b3117d6b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 596 additions and 46 deletions

View file

@ -1,3 +1,5 @@
import asyncio
from langflow.processing.process import process_tweaks
from langflow.services.deps import get_session_service
@ -263,7 +265,7 @@ def test_tweak_not_in_template():
async def test_load_langchain_object_with_cached_session(basic_graph_data):
# Provide a non-existent session_id
session_service = get_session_service()
session_service = await asyncio.to_thread(get_session_service)
session_id1 = "non-existent-session-id"
graph1, artifacts1 = await session_service.load_session(session_id1, basic_graph_data)
# Use the new session_id to get the langchain_object again