test: pin the expiry window and close settlement review gaps

This commit is contained in:
2026-09-10 05:20:56 -04:00
parent b1bc06e2b1
commit 5e2c35a812
5 changed files with 30 additions and 3 deletions
+11 -1
View File
@@ -5,6 +5,7 @@
"""
import asyncio
import time
import pytest
@@ -124,14 +125,23 @@ async def test_narrow_success_returns_value_without_pending_cancellation():
async def test_domain_error_inside_window_propagates():
"""计时器已触发但取消尚未投递的窗口内,体内先抛领域异常 → 原样上抛,期限静默让位。
忙等超过期限: 计时器回调已在 loop 上触发,但任务不挂起取消就投递不进来,
此刻体内同步抛出的领域异常必须原样逃逸(设计 §5.2 形态四)。
"""
class BoomError(RuntimeError):
pass
async def body():
end = time.monotonic() + 0.1
while time.monotonic() < end:
pass
raise BoomError("boom")
with pytest.raises(BoomError):
await with_call_deadline(body(), deadline_s=0.05, scope="llm")
await with_call_deadline(body(), deadline_s=0.02, scope="llm")
async def test_none_deadline_takes_the_legacy_path():