Skip to content

Windows CI flake: local-HTTP test promises strand mid-run ('Promise resolution is still pending'), victim test rotates — master itself red at 467e09ef6 #3530

Closed

Description

@ranxianglei

来源: PR #3144 (#3144) 分析「ci失败」(windows-latest 22, 2 红 lane)时发现

查重: 无。open+closed 全量检索过 windows flake / lane-decisions / listen-close / cancelledByParent / promise pending 等关键词,无既有跟踪项。#3490 是本家族一个已知机制的修复 PR(其加固未覆盖本残差变体);#3029 是另一类文件级崩溃(本 issue 不涉及)。

现象:同一签名,受害测试轮换

同一错误签名在两个互不相关的提交上、同一 runner 谱系(windows-latest, node 22)出现,但每次卡住的测试不同:

  1. master 自身 @ 467e09ef6:CI test (windows-latest, 22, 2) 红(job 117345098018)。tests/plugin-bypass.test.ts 的 "bypassed requests are forwarded verbatim" 挂起 5483ms 后报:
    failureType: 'cancelledByParent'
    error: 'Promise resolution is still pending but the event loop has already resolved'
    
    同文件兄弟用例被连带取消。
  2. PR [PR] fix: storage tail defects from the #3130 review (#3135) #3144 @ a217fdbae(已完整并入 master 至 467e09ef6):同 lane 红(job 117349605277)。这次是 tests/lane-decisions-matrix.test.ts 的 "dsh compress-on-wire keeps the surface" 挂起 4810ms,同一签名,约 9 个兄弟用例连带取消。

两个受害测试文件都不在 PR #3144 的 diff 里;分支上的 lane-decisions 代码与测试就是 master 原样合入的版本——排除该 PR 引入回归的可能。

与 #3490 的关系(为什么加固后还会红)

#3490(commit aa56257)修的是本家族的一个已知机制:listen(0) 落在 OS 保留端口段 → emit error 而非 listening → events.once(server,'listening') reject → promise 悬空;其 commit message 里的报错串与本 issue 逐字相同。加固内容:重试临时端口监听、teardown 用 closeAllConnections 销毁 keep-alive socket、每个测试加 60s 超时。

本次两个案例说明还有残差机制未被覆盖:事件循环已经排空(没有任何 pending handle)而 promise 仍未 settle——等待的那个东西(一次本地 HTTP 往返的响应)永远不会到达,且等待本身不持有句柄(否则 60s 超时会先触发)。受害者按时序轮换(plugin-bypass vs lane-decisions-matrix),符合环境级竞争而非特定代码缺陷的特征。

影响

  • master 自身当前就是红的(截至最后一次完成的 master CI run,467e09ef6)——不是任何在途 PR 的问题;
  • 此窗口内合并/推送的任何 PR 都可能被随机判红([PR] fix: storage tail defects from the #3130 review (#3135) #3144 今日已因此连查两轮),阻塞合并判断、消耗排查时间;
  • 仅影响 CI 判读,无用户可见行为影响。

建议方向(供接手参考,非结论)

  1. 定位能在不持有句柄的情况下让「等待本地 HTTP 响应」永久悬空的机制(候选:keep-alive agent 的 socket 在 'end'/'error' 发出前被销毁;server 在握手中途 close;windows-22 runner 网络栈时序);
  2. 给这些套件共用的本地 server/fetch 助手加有界重试 + 带 stack 的超时兜底(lane 统一决策点收尾:四处 B 类名字旁路迁入 + nudgeOn 单点(#3482) #3490 已铺部分基础,可复用);
  3. 若与 runner 镜像相关,考虑把受影响 suite 固定到更稳的 runner 版本。

Activity

  1. ranxianglei commented on Oct 17, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework · qwen3.8-27b

    (ai: vllm-qwen/qwen3.8-27b)

    补充证据(来自审核 PR #3553 的过程,同一失败域不另立项):

    • PR [PR] docs: document the pi-claude-bridge compression-state limitation (#3429) #3553(纯文档 diff,CLIENTS.md/zh 各 +2 行)head 181ca17 = master tip 494571f + 1 个 docs commit。其 CI test (windows-latest, 22, 1) 两轮连红,签名与本 issue 完全一致:
      • attempt 1(job 117376917165):tests/lane-decisions-matrix.test.ts not ok 1541–1544,首个挂起点 = 1541「dsh acp_status-only drops the surface」(6093ms);
      • attempt 2 / rerun-failed-jobs(job 117397168876):not ok 1540–1544,首个挂起点上移至 1540「dsh compress-on-wire keeps the surface」(4794ms);
      • 全部失败均为 failureType: 'cancelledByParent' + error: 'Promise resolution is still pending but the event loop has already resolved',兄弟用例连带取消。
    • 挂起点两轮之间轮换(1541→1540),与 OP 描述的「受害测试轮换」特征吻合;
    • 同 PR 的 (windows-latest, 22, 2)(hermes-native python 子进程空 stdout 断言)重跑后转绿——另一环境级竞争数据点;
    • 关键对照:base commit 494571f 自身的 CI 两个 windows 分片均绿(commits/494571fee/check-runs)——同一份代码、同一 runner 谱系能绿,证明非确定性。本窗口内 PR 红绿看运气(Windows CI flake: local-HTTP test promises strand mid-run ('Promise resolution is still pending'), victim test rotates — master itself red at 467e09ef6 #3530 OP 里 master@467e09ef6 红、现在 master tip 又绿,同窗口内交替)。

    实际代价样本:一个 4 行 markdown 的文档 PR 因该 flake 被迫做两轮全量日志取证才能排除嫌疑。

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions