Repository navigation
test: issue1452 socket-hardening — replace fixed-sleep waits with deadline polling (CI flake) - #3421
Merged
Merged
Conversation
…t fixed sleep) Discovered while reviewing PR #3409: its windows-latest(22,1) shard failed on 'retired stall guard: mid-stream silence survives any short window' (first chunk should have flowed through) — a fixed 2s wall-clock sleep that starves under runner load. Convert both fixed-sleep waits in this file that gate assertions on async events to the file's own deadline-poll idiom; the mid-stream test keeps its 2s observation floor so the negative assertions still cover a window far past the retired 400ms guard.
Contributor
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.4056-pr.3421.f093d4aThis exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr3421.tgz
npm install -g packageInstall instructions are refreshed on each push. |
…wall clock (#3435 addendum) The deadline-poll variant still budgets the wait in Date.now() time. Client, proxy and upstream share ONE process, so a single runner freeze (observed ~42s on windows-latest in run 38930761011, issue #3435) freezes the round trip AND the deadline together: the first post-unfreeze poll iteration sees the budget expired and asserts before the poll phase can deliver the chunk. Tick counting measures process-relative progress — the same frame the retired 400ms guard lives in — so arbitrarily long freezes survive; healthy runners exit after a few ticks; a dead stream stays bounded by the tick cap plus the in-process idle-budget cut.
Owner
Author
(ai: vllm-qwen/qwen3.8-27b) 来自 #3435(定时全量红灯跟踪,ce9bc90a3 上同一 flake 的第二次复现,windows-latest node 24,run 38930761011)的接力 review。已独立核对 diff 与 CI,并补推一个加固 commit 结构化八问
CI 覆盖说明:CORE 矩阵(push/PR 触发)没有 win24 腿(只有定时全量矩阵有),所以合并后真正验证失败腿的是下一次定时全量 tick;PR head 自身 CI(含 win22×2)全绿。 判定:addendum 的 checks 转绿后即可由人工合并(合并权限在人侧)。 |
Contributor
📦 Merged Build PublishedThis merge to master was published as npm install -g billion-context@0.0.498-master.076448f # this exact build
npm install -g billion-context@master # always the newest merged build
|
This was referenced Oct 17, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3420
来源: #3409 分析 PR #3409 (docs(codex) Composer-prediction eligibility gate) 时发现
What
tests/issue1452-socket-hardening.test.tsgated two assertions on async events with FIXED wall-clock sleeps, while every other wait in the same file already uses the deadline-poll idiom::403—await new Promise((r) => setTimeout(r, 2000))before asserting the first SSE chunk flowed. This is what false-failed in PR [PR] docs(codex): Codex Desktop Composer predictions — custom-provider threads are ineligible (#3408) #3409's CI (test (windows-latest, 22, 1),not ok 831 ... 'first chunk should have flowed through', subtest duration 63.7s under shard load).:317— fixed 400ms sleep before asserting the[exposure]telemetry line (100ms interval) exists; same class, passed this time on a 4× margin.Both are converted to the file's own pattern:
while (!cond && Date.now() < deadline) { await sleep(10); recheck }. The mid-stream test additionally keeps its 2s observation floor (poll up to 15s for chunk arrival, then hold until ≥2s total elapsed) so the negative assertions ("no truncation error", "no[DONE]") still cover a window far past the retiredBILI_STREAM_STALL_MS=400guard — the test's semantic claim is unchanged.Verification
node --import tsx --test tests/issue1452-socket-hardening.test.ts→ 10/10 pass.npm run typecheckclean;npm run buildOK. Full-suite verdict = remote CI on this head.seennon-empty immediately (the error frame), the floor still runs to 2s, and the existingstream error/[DONE]assertions catch it exactly as before; a true hang now fails after the 15s deadline with the same message instead of at 2s.Behavior change
None. Test-only change — no
src/, config, wire, or kernel changes. No config surface touched.Regression review
Only wait mechanics inside two tests changed; every assertion is kept verbatim. The third fixed sleep in the file (
:499, 800ms) was audited and intentionally left alone — it is a semantic negative-observation window ("with the backstop knob off the socket must still be held past the moment a 300ms backstop would have fired"), where wall-clock waiting IS the assertion, not a race against an event.