测试基建:🐛 修复前台运行 Ctrl+C 中断流程#676
Merged
Merged
Conversation
|
Thanks for your contribution! |
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.
🧭 背景
run.py与run-v4.sh提供前台执行模式,方便在终端实时观察测试输出并同步写入日志。此前用户在前台模式按下 Ctrl+C 时,信号会同时影响启动脚本、Python 流程和tee管道,容易使日志读取流程被提前打断,无法稳定等待子进程退出并完成剩余输出的落盘。🔧 主要变更
run-v4.sh在前台执行python | tee前设置trap '' INT,避免 shell 被 Ctrl+C 提前中断;命令退出后恢复默认SIGINT处理。run.py的前台日志转发增加KeyboardInterrupt处理:中断发生后继续读取并同步打印、写入子进程剩余输出,最后等待并返回子进程退出码。📁 改动文件
run.pyrun-v4.shrun-example.sh