test(todos): preserve runtime kwargs in downlevel projection stub - #4911
huangruiteng merged 2 commits into
Conversation
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
Signed-off-by: duanjialing.777 <duanjialing.777@bytedance.com>
huangruiteng
left a comment
There was a problem hiding this comment.
审阅对象:#4911 @ 73fa587ee7e69c394d32571458916edb0036bc3b。结论:APPROVE;合并权限与必要检查仍由维护者决定。
动机
生产 canonical Todo 读取已带显式 timeout=,两个旧测试替身仍只收 (method, payload),令测试在预期的缺失 provider / 缺失 readback 路径之前抛 TypeError。这是 main 与 #4906 的真实测试故障,不是要撤销生产超时。
改动思路
保持 local_authority.effect_runtime_result 的现有调用契约不动,只让测试替身接受传输选项:downlevel wrapper 把 **kwargs 原样传给真实调用后仍移除 projection_readback;split-root missing-provider stub 忽略与断言无关的传输选项,继续断言 method/params 和 fail-closed 响应。文件态与 SQLite 态的投影责任仍由生产代码承担。
具体改动
test_todo_projection_concurrency.py 的 without_confirmation 从两参改成接收并转发关键字选项;test_legacy_coordination_writer_fence.py 的 missing_provider 接收 **_kwargs。两文件 +5/-3,没有删原断言或新增重复测试;production timeout、Todo 写入与 provider 都未改。
对主干的风险
风险局限于测试替身是否遮蔽真实错误。我在 immutable base d3dc4083 重跑两个目标测试,得到 3 个参数化失败(timeout TypeError 与其下游投影症状);在此 exact head 上运行两个完整目标文件 25/25 通过,ruff 与 git diff --check 通过。原 pending outbox、无文件回退、provider revision 等断言依旧执行。缺失 provider 的 stub 本来就不验证传输选项,但生产调用没有修改;按 Goal 配置未查询/等待远端 CI。
我的整体评价
这是针对现有持久测试的最小修复,保留了 canonical read 的超时及 fail-closed 语义。没有适合在此 PR 做的相邻生产重构;若将来增加传输参数,这个测试替身继续透传,另一替身仍专注 provider 缺失合同。现有证据支持 APPROVE,不代表我执行合并。
English verdict: APPROVE - 73fa587; the two mocks accept/forward transport kwargs while preserving their failure assertions. Three baseline failures become 25 passing exact-head tests; ruff and diff check pass.
|
Exact-head CI confirmed the fix itself: all four Python shards passed. The only primary failures were the independent main defects handled by #4906: nine Node 22.18 SQLite archive failures and the 30-minute kernel timeout. To break that mutual CI dependency, commits |
Summary
effect_runtime_resultkeyword arguments through the downlevel projection test wrapperRoot cause
Commit
071f5bb3fgave canonical Todo reads an explicittimeout=. Two test doubles still accepted only(method, payload), so they raisedTypeErrorbefore their intended provider behavior ran. This caused two deterministic failures across shards 3 and 4 on main run35762701336and PR #4906 run35767660869.Validation
unexpected keyword argument 'timeout'or its caught projection symptomuv run python -m pytest -q tests/control_plane/test_legacy_coordination_writer_fence.py tests/control_plane/test_todo_projection_concurrency.py: 25 passeduv run python -m ruff check tests/control_plane/test_legacy_coordination_writer_fence.py tests/control_plane/test_todo_projection_concurrency.py: passedgit diff --check: passedScope
Test-only change. Production timeout and projection behavior are unchanged.