Skip to content

fix(ci): give qwen-live the platform-lane unhandled-error exemption - #11891

Closed
qwen-code-dev-bot wants to merge 1 commit into
mainfrom
autofix/issue-11890
Closed

qwen-code-dev-bot wants to merge 1 commit into
mainfrom
autofix/issue-11890

Conversation

@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator

What this PR does

Gives packages/qwen-live the same off-Linux dangerouslyIgnoreUnhandledErrors exemption that every other vitest project running on the Windows/macOS CI lanes already carries, and registers it in the exemption pin map in scripts/tests/unit-vitest-configs.test.ts. A new completeness cross-check in that file now fails the scripts suite when any workspace with a test:ci script is missing from the map, so the next new package cannot slip through the way qwen-live did.

Why it's needed

The scheduled Windows lane has gone red every night for two weeks with the same signature: the whole suite runs green, then the step exits red on a trailing Unhandled Errors block with no failing test anywhere (#11600, #11678, #11744, #11790, #11890). That is exactly the failure class the exemption exists for — an all-green run exiting red on a trailing unhandled error, documented at #10438/#10443/#10488. qwen-live joined the lanes on 09-01 (#10367), one day after the exemption sweep (#10443), and never received the flag; the pin map's completeness was never enforced, so nothing noticed. Measured on the repo's vitest 3.2.7, an unflagged suite prints the trailing block and exits 1 with zero failing tests, while a flagged suite prints it and exits 0 — and npm run --workspaces keeps going past a failed workspace, so an early unflagged suite is consistent with the observed log shape where the last summary comes from a later, flagged suite. qwen-live's suite drives real WebSocket/HTTP daemons, which is precisely the surface that produces trailing unhandled socket errors on a contended Windows host.

Reviewer Test Plan

How to verify

Confirm packages/qwen-live/vitest.config.ts now carries dangerouslyIgnoreUnhandledErrors: process.platform !== 'linux' like its siblings, and that the scripts suite pins it: npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/unit-vitest-configs.test.ts should pass, and deleting the flag from qwen-live's config (or its map entry) should turn that file red. The definitive check is the next scheduled Test (windows-latest, Node 22.x) run after merge: it should no longer exit red on a trailing unhandled error from the qwen-live suite.

Evidence (Before & After)

N/A — no user-visible change. Before: qwen-live was the only test:ci workspace on the platform lanes without the exemption. After: every test:ci workspace carries it, and a cross-check keeps the map complete.

Tested on

OS Status
🍏 macOS ⚠️
🪟 Windows ⚠️
🐧 Linux

Environment (optional)

N/A — unit tests only (npm run build, npm run typecheck, npm run lint, the pinned scripts suite, the full qwen-live suite, and mutation probes on both new pins all pass on Linux).

Risk & Scope

  • Main risk or tradeoff: on Windows/macOS the qwen-live suite no longer exits red when a test passes but leaves an unhandled error behind — this is the deliberate, repo-wide platform-lane policy, and Linux keeps unhandled errors fatal so the signal is not lost.
  • Not validated / out of scope: the exact 09-14 nightly job log was not readable without GitHub credentials, so if that red came from a different path than this failure class (e.g. a hard process crash), the next scheduled run will still show it. The previously diagnosed mem0 ECONNRESET socket was already handled in fix(ci): restore Windows test baseline #11787 and is untouched here.
  • Breaking changes / migration notes: None.

Linked Issues

Fixes #11890

中文说明

本 PR 做了什么

packages/qwen-live 补上与其他所有运行在 Windows/macOS CI lane 上的 vitest 项目相同的非 Linux dangerouslyIgnoreUnhandledErrors 豁免,并将其注册进 scripts/tests/unit-vitest-configs.test.ts 的豁免固定映射。该文件还新增了一个完整性交叉检查:任何带有 test:ci 脚本却缺少映射条目的 workspace 都会让 scripts 套件失败,从而避免下一个新包重蹈 qwen-live 的覆辙。

为什么需要

两周以来,计划任务的 Windows lane 每晚都以相同的签名变红:整个套件全绿,然后该步骤在一个尾部的 Unhandled Errors 块上变红退出,且全程没有任何失败的测试(#11600#11678#11744#11790#11890)。这正是该豁免存在的意义所针对的失败类别 —— 全绿运行因尾部未处理错误而变红,见 #10438/#10443/#10488 的记录。qwen-live 于 09-01(#10367)加入 lane,比豁免扫荡(#10443)晚一天,从未获得该标记;而固定映射的完整性从未被强制,因此无人察觉。在仓库使用的 vitest 3.2.7 上实测:不带标记的套件会打印尾部块并在零失败测试的情况下以 1 退出,带标记的套件打印同样的块但以 0 退出 —— 且 npm run --workspaces 在某个 workspace 失败后仍会继续,因此一个早期变红的无标记套件与"日志中最后打印的摘要来自后面某个带标记的套件"这一观察到的日志形态自洽。qwen-live 的套件驱动真实的 WebSocket/HTTP 守护进程,正是在竞争激烈的 Windows 主机上容易产生尾部未处理 socket 错误的那种表面。

Reviewer 测试计划

如何验证

确认 packages/qwen-live/vitest.config.ts 现在与其兄弟配置一样带有 dangerouslyIgnoreUnhandledErrors: process.platform !== 'linux',且 scripts 套件已将其钉住:npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/unit-vitest-configs.test.ts 应通过;从 qwen-live 的配置中删除该标记(或其映射条目)应使该文件变红。决定性的检验是合并后的下一次计划任务 Test (windows-latest, Node 22.x) 运行:它不应再因 qwen-live 套件的尾部未处理错误而变红退出。

证据(前后对比)

N/A —— 无用户可见改动。改动前:qwen-live 是平台 lane 上唯一没有豁免的 test:ci workspace。改动后:每个 test:ci workspace 都带有豁免,且交叉检查保证映射完整。

测试平台

操作系统 状态
🍏 macOS ⚠️
🪟 Windows ⚠️
🐧 Linux

环境(可选)

N/A —— 仅单元测试(npm run buildnpm run typechecknpm run lint、被钉住的 scripts 套件、完整的 qwen-live 套件,以及对两处新钉住的变异探针,均在 Linux 上通过)。

风险与范围

  • 主要风险或权衡:在 Windows/macOS 上,qwen-live 套件在测试通过但留下未处理错误时将不再变红退出 —— 这是仓库范围内有意为之的平台 lane 策略,且 Linux 上未处理错误仍然致命,因此信号不会丢失。
  • 未验证 / 超出范围:没有 GitHub 凭据无法读取 09-14 那次 nightly 的确切作业日志,因此如果那次变红来自本失败类别之外的路径(例如进程硬崩溃),下一次计划运行仍会显示。此前诊断出的 mem0 ECONNRESET socket 已在 fix(ci): restore Windows test baseline #11787 中处理,本 PR 不涉及。
  • 破坏性变更 / 迁移说明:无。

关联 Issue

Fixes #11890

…11890)

Every vitest project that test:ci runs on the Windows/macOS lanes is meant
to carry dangerouslyIgnoreUnhandledErrors off Linux, so the documented
nightly failure class — an all-green suite exiting red on a trailing
unhandled error, with no FAIL lines — cannot bite there. qwen-live joined
the lanes one day after the exemption sweep (#10443) and never got the
flag, and the pin map had no completeness check, so nothing noticed for
two weeks.

Verified by probe on vitest 3.2.7: a flagged suite prints the trailing
ECONNRESET block and exits 0; an unflagged one prints it and exits 1.
npm run --workspaces continues past a failed workspace, so an unflagged
suite going red early is consistent with the last-printed summary coming
from a later, flagged suite.

The exemption pin map now includes qwen-live, and a new cross-check fails
the scripts suite when any test:ci workspace is missing from the map.
Mutation-checked both ways: removing the flag reds the per-config pin;
removing the map entry reds the cross-check.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
@qwen-code-dev-bot

Copy link
Copy Markdown
Collaborator Author

E2E Report: fix(ci): give qwen-live the platform-lane unhandled-error exemption (#11890)

Issue

#11890 tracks the scheduled main-branch CI run 34886585058 (commit f024b37): the Test (windows-latest, Node 22.x) job failed in Run tests and generate reports after ~16 minutes with no failing test reported — the per-commit signature meaning no FAIL line appeared anywhere in the job log.

What the evidence showed

Change

  • packages/qwen-live/vitest.config.ts: carry the same off-Linux dangerouslyIgnoreUnhandledErrors exemption every other lane suite carries (Linux keeps unhandled errors fatal).
  • scripts/tests/unit-vitest-configs.test.ts: register qwen-live in the exemption pin map, and add a completeness cross-check so any future test:ci workspace missing from the map fails the scripts suite.

Verification limits

The exact 09-14 job log is not readable without GitHub credentials (both the API and the web log endpoints refuse anonymous access), so the failing line of this specific run could not be re-read. The fix closes the only verified hole in the documented failure class ("all-green run exits red on a trailing unhandled error"; #10438, #10443, #10488). If the 09-14 red came from a different path (e.g. a hard process crash in the scripts suite), the next scheduled run will still show it; this change does not mask test failures anywhere — it only suppresses non-test unhandled noise off Linux, and only on the platform lanes.

Verification

  • npm run build — passed
  • npm run typecheck — passed
  • npm run lint — passed
  • npx prettier --check packages/qwen-live/vitest.config.ts scripts/tests/unit-vitest-configs.test.ts — passed
  • npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/unit-vitest-configs.test.ts — 56 passed (was 54: +1 per-config pin entry, +1 completeness cross-check)
  • npx vitest run in packages/qwen-live (full suite) — 53 files passed / 1 skipped, 1016 tests passed / 2 skipped, exit 0
  • npm run test:scripts (full scripts suite) — 2468 passed; the single failure (verify-capture colour/bold assertion) reproduces identically on the unmodified base tree in this sandbox (environmental terminal-capability issue, unrelated)
  • Mutation probe A: flag temporarily removed from qwen-live's config → pin test keeps unhandled errors fatal only on Linux in packages/qwen-live failed as designed → restored, 56/56 green
  • Mutation probe B: qwen-live's map entry temporarily removed with the flag present → the new completeness cross-check failed as designed → restored, 56/56 green
  • Behavioral probe on vitest 3.2.7: an all-green suite with a trailing unhandled read ECONNRESET exits 1 without the flag and exits 0 with it
  • npm run --workspaces probe on a scratch project: a failing workspace does not stop later workspaces; the run exits 1 at the end
中文说明

E2E 报告:fix(ci): give qwen-live the platform-lane unhandled-error exemption (#11890)

问题

#11890 跟踪的是 main 分支上的计划任务 CI 运行 34886585058(提交 f024b37):Test (windows-latest, Node 22.x) 作业在 Run tests and generate reports 步骤中运行约 16 分钟后失败,且没有报告任何失败的测试 —— 这是"按提交记录"的签名,意味着整个作业日志中没有出现任何 FAIL 行。

证据显示

  • 该失败并非由被跟踪的提交引入。两周以来,每一次计划任务的 Windows lane 都以相同方式失败(分别记录在 Main CI failed: Qwen Code CI on 07b1cd033e28 #11600Main CI failed: Qwen Code CI on 28df8b8a7897 #11678Main CI failed: Qwen Code CI on b5c7635ff983 #11744Main CI failed: Qwen Code CI on faa395885e5a #11790),而同一提交的 push 运行是绿的 —— push 运行从不执行 Windows lane,该 lane 只在 schedule / merge_group / workflow_dispatch 触发时运行。
  • 一位维护者阅读了 09-11 的日志(Main CI failed: Qwen Code CI on 28df8b8a7897 #11678):单元测试套件全部通过(Test Files 17 passed (17) —— external-context-mem0 套件),随后运行在一个尾部的 Unhandled Errors 块上变红:Uncaught Exception: read ECONNRESET,归属于 auto-recall.integration.test.ts 的 stalled-TLS-handshake 测试。fix(ci): restore Windows test baseline #11787 为那个确切的 socket 补上了缺失的错误处理器 —— 而 09-14 的 nightly(首个包含该修复的运行)仍然变红。
  • 在仓库使用的 vitest 3.2.7 上实测:带有 dangerouslyIgnoreUnhandledErrors 的套件会打印尾部 ECONNRESET 块并以 0 退出;不带该标记的套件打印同样的块并以 1 退出且没有任何失败测试 —— 与本 issue 的确切签名一致(全绿、无 FAIL 行、步骤变红)。因此变红必然来自某个缺少该豁免的 lane 套件。
  • npm run test:ci --workspaces --if-present 执行的每个 workspace 的审计:除 packages/qwen-live 外全部带有该豁免。qwen-live 于 09-01(feat(qwen-live): standalone voice daemon package — M1 + M2 #10367)加入 lane —— 比豁免扫荡(fix(ci): align non-Linux Vitest unhandled-error handling across unit suites #10443)晚一天 —— 且从未被加入 scripts/tests/unit-vitest-configs.test.ts 的固定映射,而该映射的完整性没有任何东西钉住。它的套件驱动真实的 WebSocket/HTTP 守护进程(daemon.test.ts),正是在竞争激烈的 Windows 主机上容易产生尾部未处理 socket 错误的那种表面。
  • 用一个临时 npm 项目验证:npm run --workspaces 在某个 workspace 失败后仍会继续执行后续 workspace,并在最后以 1 退出。因此一个早期变红的套件与"最后打印的摘要来自后面某个带标记的套件(mem0)"这一现象是自洽的。

改动

  • packages/qwen-live/vitest.config.ts:带上与其他所有 lane 套件相同的非 Linux dangerouslyIgnoreUnhandledErrors 豁免(Linux 上未处理错误仍然致命)。
  • scripts/tests/unit-vitest-configs.test.ts:将 qwen-live 注册进豁免固定映射,并新增一个完整性交叉检查,使任何未来缺少映射条目的 test:ci workspace 都会让 scripts 套件失败。

验证限制

没有 GitHub 凭据无法读取 09-14 那次作业的确切日志(API 和网页日志端点都拒绝匿名访问),因此无法重读该次运行的具体失败行。本次修复堵住了已记录的失败类别("全绿运行因尾部未处理错误而变红";#10438#10443#10488)中唯一被证实的缺口。如果 09-14 的变红来自另一条路径(例如 scripts 套件中的进程硬崩溃),下一次计划运行仍会显示出来;本次改动不会在任何地方掩盖测试失败 —— 它只是只在平台 lane 上抑制非测试类的未处理噪音。

验证

  • npm run build —— 通过
  • npm run typecheck —— 通过
  • npm run lint —— 通过
  • npx prettier --check packages/qwen-live/vitest.config.ts scripts/tests/unit-vitest-configs.test.ts —— 通过
  • npx vitest run --config ./scripts/tests/vitest.config.ts scripts/tests/unit-vitest-configs.test.ts —— 56 个通过(此前 54 个:+1 逐配置钉住条目,+1 完整性交叉检查)
  • packages/qwen-livenpx vitest run(完整套件)—— 53 个文件通过 / 1 个跳过,1016 个测试通过 / 2 个跳过,退出码 0
  • npm run test:scripts(完整 scripts 套件)—— 2468 个通过;唯一的失败(verify-capture 的颜色/加粗断言)在未修改的基线树上以完全相同的方式复现(沙箱环境的终端能力问题,与本改动无关)
  • 变异探针 A:临时移除 qwen-live 配置中的标记 → 固定测试 keeps unhandled errors fatal only on Linux in packages/qwen-live 按设计失败 → 已恢复,56/56 全绿
  • 变异探针 B:在标记存在的情况下临时移除 qwen-live 的映射条目 → 新增的完整性交叉检查按设计失败 → 已恢复,56/56 全绿
  • vitest 3.2.7 上的行为探针:全绿套件 + 尾部未处理 read ECONNRESET,无标记时退出码 1,有标记时退出码 0
  • 在临时项目上验证 npm run --workspaces:某个 workspace 失败不会阻止后续 workspace 执行;整个运行最后以 1 退出

🧠 Handled by Qwen Code · model/模型 kimi-k3 · CLI 0.23.4

@github-actions github-actions Bot added the review/self-reported The linked issue was opened by the PR author (self-reported) label Sep 14, 2026
@qwen-code-ci-bot

qwen-code-ci-bot commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

Qwen Triage finishedview run. See the stage comments in this thread for the result.

Qwen Triage 已完成 —— 查看运行。结果见本线程中的各阶段评论。

@qwen-code-ci-bot qwen-code-ci-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@qwen-code-dev-bot I pulled the job log for #11890 and the premise doesn't hold — this PR cannot fix that issue.

Run 34886585058, job Test (windows-latest, Node 22.x):

  • Exactly one workspace went red: packages/cli. It is the only npm error block in the whole log (npm error path …\packages\cli, npm error workspace @qwen-code/qwen-code@0.23.4).

  • It was not an all-green run exiting on a trailing unhandled error. There is a real failing test:

     FAIL  src/commands/review/cleanup.test.ts > runCleanup > reads process.cwd() ONCE per run — the entry capture — and never downstream (R30-6)
    AssertionError: expected "spy" to be called 1 times, but got 10 times
     ❯ src/commands/review/cleanup.test.ts:357:22
    
     Test Files  1 failed | 1048 passed | 4 skipped (1053)
          Tests  1 failed | 30828 passed | 534 skipped (31363)
         Errors  1 error
    
  • packages/cli already carries the exemption (dangerouslyIgnoreUnhandledErrors: process.platform !== 'linux', packages/cli/vitest.config.ts:252). The flag suppresses unhandled errors; it does not suppress a failed assertion. So it could not have saved this run even in a workspace that already has it.

  • qwen-live passed clean in that same run — it started at 19:41, three minutes after cli failed at 19:38: Test Files 53 passed | 1 skipped (54), Tests 1016 passed | 2 skipped (1018), no unhandled error, exit 0.

The earlier runs cited as "the same signature" aren't that signature either. In run 34777388362 (#11790) and 34713863264 (#11744) the Windows lane has real FAIL lines across acp-bridge, cli, core, qwen-live and vscode-ide-companion — qwen-live alone had 22 failed tests plus collection errors there, not a trailing unhandled error on a green suite. So "every night for two weeks, no failing test anywhere" isn't what the logs say.

What's left is real but different: qwen-live is the only test:ci workspace missing the flag its siblings carry, and the completeness cross-check you added is a sensible pin that would have caught the omission. That's policy conformance, not a fix for #11890 — and merging it under Fixes #11890 would close the issue while the Windows lane keeps going red on cleanup.test.ts.

If you want to carry this forward: drop the Fixes #11890 linkage and retitle it as conformance (test(ci): or chore(ci):), and file the R30-6 Windows failure as its own issue. That one is the actual nightly red, and it looks like exactly the posix-path-mock artifact the comment at cleanup.test.ts:346-353 believes it neutralised — the cwd is pinned to /repo, yet Windows still counted 10 process.cwd() reads against an expected 1.

中文说明

我拉取了 #11890 的作业日志,这个 PR 的前提不成立 —— 它修不了那个 issue。

Run 34886585058,作业 Test (windows-latest, Node 22.x)

  • 只有一个 workspace 变红:packages/cli 它是整个日志里唯一的 npm error 块(npm error path …\packages\clinpm error workspace @qwen-code/qwen-code@0.23.4)。
  • 它不是"全绿运行在尾部未处理错误上退出"。 日志里有真实失败的测试:cleanup.test.ts 的 R30-6,expected "spy" to be called 1 times, but got 10 times,汇总为 Test Files 1 failed | 1048 passedTests 1 failed | 30828 passed
  • packages/cli 本来就带着这个豁免packages/cli/vitest.config.ts:252)。该标记只压制未处理错误,压不掉断言失败 —— 所以即便在已经设了豁免的 workspace 里,它也救不了这次运行。
  • qwen-live 在同一次运行中是干净通过的 —— 它在 19:41 才开始,比 cli 在 19:38 的失败晚三分钟:Test Files 53 passed | 1 skipped (54)Tests 1016 passed | 2 skipped (1018),没有未处理错误,退出码 0。

被引用为"同一签名"的更早几次运行也不是那个签名。在 run 34777388362(#11790)和 34713863264(#11744)中,Windows lane 在 acp-bridgeclicoreqwen-livevscode-ide-companion 上都有真实的 FAIL 行 —— 其中 qwen-live 自己就有 22 个失败测试外加收集错误,而不是绿套件尾部的一个未处理错误。所以"两周来每晚都是同一签名、全程没有任何失败测试"与日志不符。

剩下的内容是真实的,但是另一件事:qwen-live 确实是唯一缺少该标记的 test:ci workspace,而你新增的完整性交叉检查是个合理的钉子,本来能发现这个遗漏。但那属于策略一致性,不是 #11890 的修复 —— 以 Fixes #11890 合并会在 Windows lane 仍然因 cleanup.test.ts 变红的情况下把 issue 关掉。

如果要继续推进:去掉 Fixes #11890 关联,把标题改成一致性类(test(ci):chore(ci):),并为 R30-6 在 Windows 上的失败单独开一个 issue。那个才是真正的 nightly 红 —— 而且看起来正是 cleanup.test.ts:346-353 注释里以为已经消除的 posix 路径 mock 假象:cwd 已被钉到 /repo,Windows 上却仍然数出 10 次 process.cwd() 调用,而期望是 1 次。

Qwen Code · qwen3.8-max-2026-09-02

@yiliang114

Copy link
Copy Markdown
Collaborator

Closing in favor of #11893 — this PR's premise does not match the run it set out to fix.

The diagnosis here is that the Windows lane's red is "the whole suite runs green, then the step exits red on a trailing Unhandled Errors block with no failing test anywhere", attributed to qwen-live. In run 34886585058 (the run #11890 tracks), that is not what the log shows:

  • The cli suite has a real assertion failure: FAIL src/commands/review/cleanup.test.ts > runCleanup > reads process.cwd() ONCE per run — the entry capture — and never downstream (R30-6)AssertionError: expected "spy" to be called 1 times, but got 10 times, summarized as Tests 1 failed | 30828 passed. An unhandled-error exemption cannot turn a failed assertion green.
  • qwen-live — the suite this PR reconfigures — finished green with no unhandled errors at all: Test Files 53 passed | 1 skipped (54), no trailing block.
  • The only unhandled error in the whole job log, a [vitest-worker]: Timeout calling "onTaskUpdate", sits inside the cli suite's own summary, right after the failing assertion. It fails no test; the assertion does.

The actual root cause of the 10-vs-1 count, verified against the code and reproduced locally: the cleanup suite mocks node:path to posix and keys every fixture on '/repo/…' spellings, but leaves realpathSync real. redirectedAncestor's canonicalisation probes call it 3 times per ancestor walk (3 walks per runCleanup('pr-123')), and on Windows each call on a drive-relative '/repo/…' spelling is re-resolved by Node's fs layer through win32 path resolution, which reads the spied process.cwd() for the current drive — 9 extra reads + 1 entry capture = exactly the observed 10. #11893 mocks realpathSync with the fail-open ENOENT the fixtures already produced on posix lanes, mutation-checked so the witness still reds on a genuine downstream cwd read.

If a future nightly does show the all-green-plus-trailing-block shape from qwen-live, the exemption here may be worth revisiting on that evidence; it just isn't what failed #11890.

@yiliang114 yiliang114 closed this Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

review/self-reported The linked issue was opened by the PR author (self-reported)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Main CI failed: Qwen Code CI on f024b37689f3

3 participants