fix(ostool): throttle shell init input#148
Merged
Merged
Conversation
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.
问题
rcore-os/tgoskits#1391中的 Starry x86_64tty-console-input-burstCI 超时并不是单个测试超时时间不足。失败日志显示系统已经进入 Starry shell,并开始接收shell_init_cmdheredoc,但后续 EOF 和执行命令没有稳定完成。根因在 ostool 的自动 shell 初始化输入路径:检测到
shell_prefix后,当前实现会把整个shell_init_cmd作为一个大块一次性写入 QEMU/serial stdin。长 heredoc 会形成输入 burst,容易超过 guest console/TTY 的处理窗口,导致 shell 初始化命令卡在半途。修改
TerminalHandle增加send_after_chunks,支持延迟后按固定大小拆分输入,并在 chunk 间短暂让出。shell_init_cmd注入改成 64 字节一块、块间 2ms 发送。验证
cargo fmt --all -- --checkcargo clippy --target x86_64-unknown-linux-gnu --all-featurescargo test --target x86_64-unknown-linux-gnu -- --nocapture[patch.crates-io]指向本地 ostool 后验证原失败用例:cargo xtask starry test qemu --arch x86_64 -c qemu-smp1/tty-console-input-burst结果:
PASS tty-console-input-burst,all starry qemu tests passed。Fixes rcore-os/tgoskits#1391