Skip to content

[test] canon dangling test asserts on its own scratch-dir name #1607

Closed

Description

@caomengxuan666

现象

rust-tests job(PR #1605 落地后首次在 CI 跑 cargo test -p winux-cmds)572/5 中的 1 个:

canon::dangling_tests::all_but_last_and_missing_resolve_dangling_leaf,panic 于 rust2/crates/winux-cmds/src/canon.rs:310:13:mode=AllButLast got C:\\Users\\runneradmin\\AppData\\Local\\Temp\\winux-cmds-test-canon-dang-1794543064997878700\\z_absent_tgt

X299 复现同形(同一行、同一形状,仅 temp 后缀不同)。

根因(钉子,非产品)

断言是 assert!(!r.contains("dang"), "mode={mode:?} got {r}")。产品返回的绝对路径本身是对的(GNU readlink -f/realpath -m 印 <parent>/z_absent_tgt);路径里唯一的 "dang" 是 scratch 目录名本身:ScratchCtx::new("canon-dang")。子串断言在该 temp 目录下的任何绝对路径上都自败。

修法

改 scratch context 名(如 "canon-d"),或按 path component 断言而非子串。无产品改动。

来源

PR #1605 复核(Refs #1604):CI 572/5 + X299 第二路径复现。rust-tests job 现已在 master 上跑,本单即其报出的信号之一。

Activity

  1. added
    bug
    on Nov 13, 2026
  2. added a commit that references this issue on Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions