mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-01 13:33:48 +08:00
Refa: GraphRAG to use async chat methods instead of thread pool execution (#14002)
### What problem does this PR solve? GraphRAG _async_chat. ### Type of change - [x] Refactoring - [x] Performance Improvement <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Refactor** * Unified chat calls to an async invocation across extractors, improving timeout handling and ensuring task IDs propagate reliably. * **Tests** * Added and expanded unit tests and mocks to cover extractor behavior, timeout scenarios, and safe test-package imports, reducing regression risk. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
This commit is contained in:
21
test/unit_test/test_test_chunk_feedback_package.py
Normal file
21
test/unit_test/test_test_chunk_feedback_package.py
Normal file
@@ -0,0 +1,21 @@
|
||||
import importlib
|
||||
import sys
|
||||
from types import ModuleType
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.p2
|
||||
|
||||
|
||||
def test_chunk_feedback_package_import_is_safe_when_common_is_shadowed(monkeypatch):
|
||||
shadow_common = ModuleType("common")
|
||||
monkeypatch.setitem(sys.modules, "common", shadow_common)
|
||||
monkeypatch.delitem(
|
||||
sys.modules,
|
||||
"test.testcases.test_web_api.test_chunk_feedback",
|
||||
raising=False,
|
||||
)
|
||||
|
||||
module = importlib.import_module("test.testcases.test_web_api.test_chunk_feedback")
|
||||
|
||||
assert module is not None
|
||||
Reference in New Issue
Block a user