From 49e40d74f1c45cdb898fb80b7dc1546c97fbf463 Mon Sep 17 00:00:00 2001 From: "Xin.Zh" Date: Fri, 23 Oct 2026 17:55:44 +0800 Subject: [PATCH] test(runtime): await commit-lock recovery settlement Allow the existing recovery test to wait beyond the default write budget instead of treating the short best-effort flush as proof of persistence. Constraint: Keep runtime defaults and the blocked-write latency assertion. Scope-risk: One test fixture; rollback and connection checks remain intact. Tested: Existing test red/green with 0.65s controlled consumer delay. Tested: Usage recorder module, 32 passed; scoped Ruff, format and Python 3.11 Ty. --- tests/builtin/runtime/test_model_usage_recorder.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/builtin/runtime/test_model_usage_recorder.py b/tests/builtin/runtime/test_model_usage_recorder.py index 46f186a029..46208b7257 100644 --- a/tests/builtin/runtime/test_model_usage_recorder.py +++ b/tests/builtin/runtime/test_model_usage_recorder.py @@ -730,7 +730,8 @@ async def scenario() -> None: path = tmp_path / "commit-locked.db" config = SQLiteConfig(url=f"sqlite+aiosqlite:///{path}", journal_mode="DELETE") async with _database(config) as database: - recorder = _ModelUsageRecorder(database, StatisticsRepository()) + # Recovery requires settlement beyond the default one-second write budget. + recorder = _ModelUsageRecorder(database, StatisticsRepository(), flush_timeout_seconds=2.0) reader = sqlite3.connect(path) try: reader.execute("BEGIN")