fix: cover httpx disconnect family in transient error set
This commit is contained in:
@@ -259,6 +259,16 @@ async def test_qwen_thinking_stripped():
|
||||
assert thinking2 == ""
|
||||
|
||||
|
||||
def test_transient_covers_disconnect_family():
|
||||
"""瞬时错误清单覆盖断连族(RemoteProtocolError/ReadError/ConnectTimeout/PoolTimeout)。"""
|
||||
from adapters.llm import _is_transient_error
|
||||
|
||||
assert _is_transient_error(httpx.RemoteProtocolError("peer reset"))
|
||||
assert _is_transient_error(httpx.ReadError("read"))
|
||||
assert _is_transient_error(httpx.ConnectTimeout("ct"))
|
||||
assert _is_transient_error(httpx.PoolTimeout("pt"))
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_truncated_stream_without_done_raises():
|
||||
"""SSE 流耗尽但未收 [DONE] → _SseAnomaly(进重试,不当成功)。"""
|
||||
|
||||
Reference in New Issue
Block a user