Skip to content

[PR] test: follow-up #5016 — #4982 regression test cannot pass as written (self-contradictory assertion + teardown deadlock) - #5019

Closed
ranxianglei wants to merge 0 commit into
masterfrom
2026-10-28_followup-5016-twin-verdict-assertion
Closed

ranxianglei wants to merge 0 commit into
masterfrom
2026-10-28_followup-5016-twin-verdict-assertion

Conversation

@ranxianglei

Copy link
Copy Markdown
Owner

Post-merge supplement to PR #5016 (fix for issue #4982).

查重: 无在途同类 PR(出站检索 open+closed issues/PRs,失败签名 = tests/issue4982-draining-twin-ladder.test.ts + ERR_ASSERTION ... twin-collision + cancelledByParent)。

What's wrong

PR #5016 shipped its regression pin with two latent test-side defects, both on code paths that only execute once the fix under test works — which is why pre-fix CI was green on this file and post-merge CI is red on it, on every shard/platform:

  1. Self-contradictory assertion. The demotion warn added by the fix (src/server.ts) contains the literal text twin-collision: ...treating the port as foreign-held instead of dying twin-collision (#4982). Test B asserts BOTH match(logText, /no longer answers as itself/) AND doesNotMatch(logText, /twin-collision/, ...) over the same log — impossible to satisfy whenever the demotion path fires (which is exactly what the test triggers). Deterministic failure: ERR_ASSERTION 'an unverified claim must never reach the twin-collision verdict'.
  2. Teardown deadlock (latent, masked by fix: keep system prompt byte-stable for prefix cache #1). The silentTcpListener fixture accepted probe connections and held them; a socket with no data listener stays paused, so peer EOF is never delivered once the probing child dies, leaving CLOSE-WAIT sockets that pin squatter.close() forever (observed via ss during the hang: 4× CLOSE-WAIT owned by the test pid, peers FIN-WAIT-2 with no owning process). The test then ends by node:test cancellation (cancelledByParent, 'Promise resolution is still pending but the event loop has already resolved').

What changed (tests/issue4982-draining-twin-ladder.test.ts only)

  • Pin the twin-collision verdict by its unique log marker already served by a same-build bili instance (shared by the early Pi duplicate startup writes index.db before twin adoption and disables unified storage #4341 path and the late path; absent from both warn lines) instead of the substring twin-collision; test A's parallel assertion gets the same marker.
  • Fixture now drains each connection (sock.resume()) and destroys it on EOF, so dead probers can no longer pin close().

Behavior change flag

None — pure test-file change, zero production code touched. No config surface, no wire shape, no persistence format.

Verification

  • Local: file runs 6/6 twice consecutively (4 unit + both e2e), 0 cancelled; npm run typecheck clean.
  • Full-suite verdict: remote CI on this head.
  • Until this merges, master CI stays red on this one file (inherited red from the merge); merging restores clean.

@ranxianglei ranxianglei changed the title test: follow-up #5016 — #4982 regression test cannot pass as written (self-contradictory assertion + teardown deadlock) [PR] test: follow-up #5016 — #4982 regression test cannot pass as written (self-contradictory assertion + teardown deadlock) Oct 28, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 Built Package Artifact

Branch: 2026-10-28_followup-5016-twin-verdict-assertion (ec1ffa8)

Latest build — install this exact version

npm install -g billion-context@0.0.6618-pr.5019.4d2c72e

This exact version is immutable and reproducible. The rolling pr tag tracks the newest test build across all PRs.

Recent builds (commit → version)

commit version build
ec1ffa8 billion-context@0.0.6618-pr.5019.4d2c72e build

Download artifact

  1. Download the artifact from the Actions run
  2. Extract the tarball and install:
tar xzf billion-context-pr5019.tgz
npm install -g package

Install instructions are refreshed on each push.

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

查重:不重复。 独立复核出站检索——open+closed 里唯一携带本失败签名(tests/issue4982-draining-twin-ladder.test.ts + ERR_ASSERTION ... twin-collision + cancelledByParent)的就是本 PR;原 #4982/#5016 的分支已随 b08fbf361 合入,无在途并列修复。

审核独立性: 未照抄 PR 描述,对 PR 分支头 ec1ffa870 逐处重新取证,两条缺陷都独立钉死,修复也精确命中根因:

缺陷 1(自相矛盾断言)— 属实,修复正确。

  • src/server.ts:1427 的降级 warn 原文同时含 no longer answers as itself 与 twin-collision:「…treating the port as foreign-held instead of dying twin-collision ([PR] release v0.1.209 #4982)」。
  • 测试 B 在同一份 logText 上同时断言 match(/no longer answers as itself/) 与 doesNotMatch(/twin-collision/)——降级路径一触发必然矛盾,故 pre-fix 绿、post-merge 每个 shard/platform 必红。
  • 新 marker already served by a same-build bili instance 正是 twin-collision 判决提示语(src/server.ts:652 早期 Pi duplicate startup writes index.db before twin adoption and disables unified storage #4341 路径 + :1467 晚期路径),两条 warn 都不含它。控制流也对得上:降级后 twinHolds 被清,decideEaddrinuse 走 ladder(:1449)而非 fail-fast/twin-collision,:1467 判决提示语根本落不到日志——新负断言恰好钉住「判决缺席」。测试 A 的平行断言(判 p2.out.value)换同一 marker 同理成立。

缺陷 2(teardown 死锁)— 机制成立,修复标准。

  • 旧 fixture net.createServer(() => {}) accept 后持连接且无 data listener → socket 停 paused,prober 子进程死后 peer EOF 送不到,CLOSE-WAIT 把 squatter.close() 钉死(作者 ss 实测 4× CLOSE-WAIT、peer FIN-WAIT-2)。
  • 新写法 sock.resume() + sock.on("end", () => sock.destroy()) 是 drain+释放的标准手法,死 prober 不再卡住 close()。

行为变更: 无——纯测试文件,零生产代码;无配置面/wire shape/持久化格式。

CI(head ec1ffa870): 仍在跑,当前 0 失败、两个 gate job 已绿;按 §7.2 全量裁决以远程 CI 为准。合并前 master 在该文件上保持继承红,合并即恢复干净。

结构化八问:

  1. 是什么问题:PR [PR] fix: draining proxy no longer claims its freed port — same-lane newcomer ladders instead of dying twin-collision (#4982) #5016 给 [PR] release v0.1.209 #4982 打的回归 pin 自身有两处测试侧缺陷,pin 一旦遇到「被测修复真的生效」就必然失败——即修好了反而测不过。
  2. 什么原因导致:①负断言禁的词(twin-collision)恰是降级 warn 自己的措辞;②fixture 持有空闲连接不 drain,死 prober 的 CLOSE-WAIT 钉死 close()。二者都只在被测修复工作的路径上触发,所以 pre-fix 绿、post-merge 红。
  3. 影响范围与严重程度:仅这一个回归测试文件在 CI 层红,不影响任何生产行为/用户;因 master 继承红会污染后续所有 PR 的门禁信号,但绕行=本 PR 本身,判 p2。
  4. 怎么修的:①用判决提示语的独有 marker 替代会误伤 warn 的子串来钉「判决缺席」;②fixture drain+destroy 释放连接。均为策略层修正,非掩盖症状。
  5. 是否回归:无。只动一个测试文件,不碰任何生产路径;既有行为(降级→ladder→不判 twin-collision)未变,只是断言口径从「误伤词」改为「真判决词」。
  6. 是否破坏缓存:不涉及(纯测试)。
  7. 是否改设计方向:不涉及。
  8. 是否引入新配置:不涉及。

合并判定: 代码层面已独立验证两处缺陷真实存在、修复精确命中根因;纯测试改动、零行为变更。等远程 CI 全绿即可由 owner 合入——这是把 master 从继承红拉回绿的必要一步。

@ranxianglei

Copy link
Copy Markdown
Owner Author

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

本 PR 已被 CI 哨兵并入 ci-fixes,无需再独立合并:

待 owner 关闭本 PR。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

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

先汇报进程状态:我上一轮收尾后卡住 ~31min 被强制重启。卡点大概率是我在收尾后本地重跑了那个会 spawn 子进程、绑端口的 e2e 测试(tests/issue4982-draining-twin-ladder.test.ts)——正是本 PR 修的那类 teardown 挂起,在共享环境里复现成了长时间无输出(我没有留下确切日志,但这是范围内唯一的重型本地操作、且与该测试已知挂起画像吻合)。已避开该操作,不再本地跑这个重型 e2e,裁决一律以远程 CI / #5017 为准。

收敛处置已独立核验(非照抄线程):用本地缓存的安全只读检查确认——

两处缺陷的验证结论维持不变(上一轮已钉死):① 断言自相矛盾属实——src/server.ts:1427 降级 warn 正文自带 twin-collision,原 doesNotMatch(/twin-collision/) 必挂;改钉唯一判决标记 already served by a same-build bili instance(src/server.ts:652/:1467)正确。② teardown drain+destroy(sock.resume() + end 时 destroy)为标准手法。

剩余动作 = owner-only:关闭 #5019 只能由 owner 执行(agent 不关单)。我不关闭、仅留此说明。改动已随 ci-fixes 落地,建议 owner 在 #5017 合入后关闭本 PR(内容既已在 ci-fixes,现在关闭亦可)。

判定: 无需我进一步动手;待 #5017 合入 + owner 关闭即可收工。

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

#5019 处理完毕,汇报结论:

做了什么

  1. 识别为 agent 自产 [PR](follow-up [PR] fix: draining proxy no longer claims its freed port — same-lane newcomer ladders instead of dying twin-collision (#4982) #5016 → [PR] release v0.1.209 #4982),按规则走「核验 + 汇报」而非重做。
  2. 独立取证(非照抄):两处缺陷均属实——① src/server.ts:1427 降级 warn 正文自带 twin-collision,原 doesNotMatch(/twin-collision/) 自相矛盾必挂;改钉唯一判决标记 already served by a same-build bili instance(src/server.ts:652/:1467)正确。② teardown drain+destroy(sock.resume() + end 时 destroy)为标准手法。
  3. 安全只读核验收敛:origin/ci-fixes 顶端即 499f69ef9,只改该测试文件(12+/4-,内容等同 ec1ffa870),载体为 PR [PR] ci: converge master-CI fixes (register issue4982 spawning suite in LIVE_FILES) #5017(ci-fixes→master)。

结果

@ranxianglei

Copy link
Copy Markdown
Owner Author

🤖 Powered by ework · qwen3.8-27b

[bot] 🏷 (ai: vllm-qwen/qwen3.8-27b)

状态(第二次重启后):本 issue 的工作上一轮已全部完成,本轮我只做了一次快速只读检查、未发起任何长耗时操作——这次「卡住 31min」应是任务收尾后进程空转等待被看门狗判为卡死,并非真实挂起。

当前实时进展(刚查):

待办:无我的动作。唯一剩余 = owner 关闭 #5019(建议 #5017 合入后执行)。

为避免刷屏的说明:此任务对我已收工。后续若无实质新事件(CI 转红/合入、owner 评论),我不会再就同一状态重复发帖;真正的新事件会重新唤醒我处理。若你希望我在 #5017 合入或 CI 全绿时主动回报一次,回一句即可,否则我就静默等事件驱动。

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