Repository navigation
飞书子进程等待退出时,哨兵先于退出码就绪也不再断言失败 - #121
Merged
Merged
Conversation
- ForkedProcess.wait 在哨兵可读后若还拿不到退出码,在线程里 join 一次再读; spawn 等启动方式下哨兵是子进程退出时关闭的管道,waitpid 要稍后才能回收。 - 主干 CI(Linux)上 test_forked_process_reports_exit_code 因此连续两次失败,挡住发布。 - 新增用例模拟「哨兵已可读、退出码未就绪」。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题
#120 合并后主干 CI 连续两次失败在
tests/unit/test_feishu_forkserver.py::test_forked_process_reports_exit_code(coreman/runtime/gateway_feishu/service.py:81: AssertionError),发布脚本因 CI 未通过而拒绝部署。ForkedProcess.wait()等进程哨兵可读后直接读exitcode并断言不为空。spawn 等启动方式下哨兵是子进程退出时关闭的管道,Linux 上waitpid(WNOHANG)可能要稍后才能回收,于是退出码还是 None。生产用 forkserver,哨兵里写的就是退出码,基本不受影响;但 wait 不该在这种时序上断言失败。改动
join一次(进程已退出,很快返回)再读。验证
uv run pytest tests/unit/test_feishu_forkserver.py:6 passed;ruff、mypy 通过。本机 macOS 复现不了原失败,CI(Linux)上验证。🤖 Generated with Claude Code