Skip to content

WIP: test(debugger): quote sourced-script path in wiring tests — clears #1878 goldens red (8 wiring tests) - #1885

Merged
caomengxuan666 merged 1 commit into
masterfrom
fix/wiring-goldens-path-quote
Oct 27, 2026
Merged

caomengxuan666 merged 1 commit into
masterfrom
fix/wiring-goldens-path-quote

Conversation

@caomengxuan666

Copy link
Copy Markdown
Member

WIP: 清除 PR #1878 引入的 master goldens 常驻红 8 条(debugger::wiring_tests)。

根因(一句话):8 条测试共用的 sourced_script() 把临时脚本的本机路径未加引号插进驱动输入(. C:\Users\...),裸词中反斜杠是转义符、分隔符被逐个吃掉,. 找不到文件,被调试脚本零执行、status 1——与 #1883 里 consumer act2 的已定谳机制同形(de01 的 panic 即 wiring_tests.rs:142 的 status 断言 left 1 / right 0)。

修法:引号收进 sourced_script() 这唯一的插值 helper(+11/−1,只动 doc 注释与一行 format),9 个调用点同修;产品代码零改动,被调试脚本与状态语义未动。全仓审计确认把本机路径插进 shell 源码的点仅此一处未带引号(另一处 consumer_tests.rs:424 已在 #1883 带引号)。

逐名对应(8 条全部经 sourced_script 进入,修此一处即全修):

  • de01_entry_stop_served_before_first_command("entry")
  • de02_line_breakpoint_parks_and_resume_completes("linebp",含 debugger-off 对照段同一 input)
  • de02_conditional_breakpoint_evaluates_in_frame("condbp",两段)
  • de03_function_breakpoint_stops_at_entry_seam("fnbp")
  • de04_frame_return_event_and_finish_arming("finish")
  • de07_async_stop_serviced_at_boundary_poll("async")
  • detach_at_entry_lets_debuggee_run_free("detach")
  • de09_session_exited_from_finish_side("exitbuiltin" + "naturalend" 两段)

本地门:pristine 与改后 lib 全量同为 789/1/1,失败集逐名全等(唯一存量 ownership_unary_operators_check_existing_file);-D warnings rc=0;UTF-8 边界卫生门 clean;改动文件 CR=0、rustfmt 无新增漂移(:585 一处为 pristine 既存漂移、未动)。

验收以本 PR 的 CI 为准:goldens 失败集须为空集。不自合。

The 8 debugger::wiring_tests that have failed only in the
Windows goldens job since #1878 all drive the debuggee through
sourced_script(), which interpolated the temp script's native
path into the driver input unquoted: `. C:\Users\...`. In a
bare word the lexer treats `\` as an escape, every separator
was eaten, `.` never found the file, and each debuggee exited
status 1 having executed nothing (de01's status assertion at
wiring_tests.rs:142 — left 1, right 0).

Quote the path at the helper, the single interpolation point
all nine call sites share — the same harness shape the api
consumer tests were fixed with in #1883. No product code
changes; the debuggee scripts and their status semantics are
untouched.
@caomengxuan666

Copy link
Copy Markdown
Member Author

CI 裁定证据(wiring-goldens-fix 簇)

本 PR 的目标面已达成:goldens 作业 step 4「Run Rust library tests」在第 1、2 两轮均为 success —— 8 条 wiring 测试(de01/de02×2/de03/de04/de07/de09/detach)在 Windows goldens 环境全部转绿,--log-failed 逐名核对零命中。其余作业全 pass:Rust tests / Rust tests (macOS) / Shell functionality / niubash canary / Cross-target ×2 / API ledger。

但 goldens 作业整体仍是 FAILURE,原因在 step 5,且与本 PR 的改动无因果:step 5「Run regression suite」此前在 master 上一直被 step 4 的红跳过(实证:master run 40563880789 @03a75183、40533525107 @0f16cf28、40542451456 @a52fddc2 的 goldens 作业均为 step4=failure → step5=skipped)。本 PR 让 step 4 转绿后,step 5 首次真正执行,暴露出一条先存的、被掩盖至今的快照分歧 upstream_suite_slice_snapshots,两轮录到的字节逐字节相同(确定性,非 flake),与仓内金标的差异恰两处:

  1. errors.snap:63:金标 after history: 2,runner 实录 after history: 1。来源 = errors10.sub:39-41(history abcde → 2 两边一致;history 10 42(too many arguments)GNU 为 2、Windows runner 上 rubash 为 1)。
  2. redir.snap:104-111:金标的两组 1 2 3 4 在实录中整组缺失。来源 = redir8.sub 的 exec 10<infile; exec 0<&10; cat <&10 与 exec 8<infile; exec 0<&8; cat <&8 两段(Windows runner 上读到 EOF、零输出);其余 fd 段(>&10/>&8/cat u)两边一致。

定性:本簇在 Linux 上以脚本文件对 GNU 5.3.20 oracle 与 master 二进制逐段双跑,两处 rubash 均与 GNU 逐字节一致(history 两调用皆 2 且诊断同文;redir 两段皆输出 1-4)。故两处分歧是当前 master 产品代码的 Windows 面行为,与本 PR 的 test-only 改动(src/debugger/wiring_tests.rs +11/−1,不进产品二进制)无任何因果通道。

处置(交主会话裁):按本簇任务书「发现产品真分歧则停手回报」与 tests/regression.rs 文件头的重录纪律(重录必须指名导致字节漂移的引擎改动;本 PR 无引擎改动),本簇未重录金标、未动产品语义。建议:为上述两处 Windows 面分歧另行立案(history 参数校验的 Windows 状态面 / exec fd 移动后读空的 Windows handle 面),修复后本作业即全绿。本 PR 保持 draft、不自合。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant