Skip to content

OpenRAG is a comprehensive, single package Retrieval-Augmented Generation platform built on Langflow, Docling, and Opensearch.

Python

Remove Asyncio sleep

Edwin Josee199dd454501
diff --git a/tests/integration/sdk/test_chat.py b/tests/integration/sdk/test_chat.py
index f3542f138..501337c87 100644
--- a/tests/integration/sdk/test_chat.py
+++ b/tests/integration/sdk/test_chat.py
@@ -1,6 +1,5 @@
"""Tests for the chat endpoint — non-streaming, streaming, conversations, and RAG."""
-import asyncio
import os
from pathlib import Path
@@ -117,8 +116,6 @@ class TestChat:
if result.status == "failed" or result.successful_files == 0:
pytest.skip("Document ingestion failed — cannot test RAG sources")
- await asyncio.sleep(3)
-
response = await client.chat.create(
message="What is the color of the dancing animals mentioned in my documents?"
)
diff --git a/tests/integration/sdk/test_e2e.py b/tests/integration/sdk/test_e2e.py
index bc40450cf..2b13ad45f 100644
--- a/tests/integration/sdk/test_e2e.py
+++ b/tests/integration/sdk/test_e2e.py
@@ -1,6 +1,5 @@
"""End-to-end tests covering full multi-step SDK workflows."""
-import asyncio
import os
import uuid
@@ -30,8 +29,6 @@ class TestEndToEnd:
if ingest_result.successful_files == 0:
pytest.skip("Ingestion produced no indexed chunks — skipping E2E RAG test")
- await asyncio.sleep(3)
-
search_results = await client.search.query("flamingo Zephyr planet Xylox")
assert search_results.results is not None
@@ -63,8 +60,6 @@ class TestEndToEnd:
if ingest_result.successful_files == 0:
pytest.skip("Ingestion produced no indexed chunks — skipping multiturn test")
- await asyncio.sleep(3)
-
r1 = await client.chat.create(message="What is the capital of Valdoria?")
assert r1.chat_id is not None
diff --git a/tests/integration/sdk/test_search.py b/tests/integration/sdk/test_search.py
index aa4cb430a..c917f335f 100644
--- a/tests/integration/sdk/test_search.py
+++ b/tests/integration/sdk/test_search.py
@@ -1,6 +1,5 @@
"""Tests for the search endpoint."""
-import asyncio
import os
from pathlib import Path
@@ -19,7 +18,6 @@ class TestSearch:
async def test_search_query(self, client, test_file: Path):
"""A basic search query returns a results list."""
await client.documents.ingest(file_path=str(test_file))
- await asyncio.sleep(2)
results = await client.search.query("purple elephants dancing")
assert results.results is not None
@@ -32,7 +30,6 @@ class TestSearchExtended:
async def test_search_with_limit(self, client, test_file: Path):
"""limit parameter caps the number of results returned."""
await client.documents.ingest(file_path=str(test_file))
- await asyncio.sleep(2)
results = await client.search.query("test", limit=1)
assert results.results is not None
@@ -42,7 +39,6 @@ class TestSearchExtended:
async def test_search_with_high_score_threshold_returns_empty(self, client, test_file: Path):
"""A score_threshold of 0.99 should filter out most or all results."""
await client.documents.ingest(file_path=str(test_file))
- await asyncio.sleep(2)
results = await client.search.query("test", score_threshold=0.99)
assert results.results is not None
@@ -66,9 +62,8 @@ class TestSearchExtended:
@pytest.mark.asyncio
async def test_search_returns_result_fields(self, client, test_file: Path):
- """Each search result must have content populated as a string."""
+ """Each search result must have text populated as a string."""
await client.documents.ingest(file_path=str(test_file))
- await asyncio.sleep(2)
results = await client.search.query("purple elephants dancing", limit=5)
for result in results.results: