Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

fix(container-test): batch create segment position sort (#25394)

Novice566e0fd3e5b5
diff --git a/api/tests/test_containers_integration_tests/tasks/test_batch_create_segment_to_index_task.py b/api/tests/test_containers_integration_tests/tasks/test_batch_create_segment_to_index_task.py
index b77975c032a..065bcc2cd71 100644
--- a/api/tests/test_containers_integration_tests/tasks/test_batch_create_segment_to_index_task.py
+++ b/api/tests/test_containers_integration_tests/tasks/test_batch_create_segment_to_index_task.py
@@ -296,7 +296,12 @@ class TestBatchCreateSegmentToIndexTask:
from extensions.ext_database import db
# Check that segments were created
- segments = db.session.query(DocumentSegment).filter_by(document_id=document.id).all()
+ segments = (
+ db.session.query(DocumentSegment)
+ .filter_by(document_id=document.id)
+ .order_by(DocumentSegment.position)
+ .all()
+ )
assert len(segments) == 3
# Verify segment content and metadata