Repository navigation
test(#1785): raise dsh-native attach-mode poll budget from 5s to 15s for loaded hosts - #1793
Conversation
…oaded hosts The shared waitFor cap plus two inline attach polls used a fixed 5s/4s wall-clock deadline around a real loopback manifest round-trip. On a heavily loaded dev host (CPU/event-loop starvation) that round-trip can exceed 5s wall-clock, tripping uniform ~5s timeout failures across the attach cluster (one #1130 case + five #1365 cases) even though the same code passes in CI and on a light host. Centralize the budget in POLL_DEADLINE_MS (15000) and apply it to all three sites. Fast CI (sub-second) is unaffected; a genuine hang still fails, just later. Test-only; no product/wire/config/persistence impact.
📦 Built Package ArtifactBranch: Option A — Install this exact build (recommended)npm install -g billion-context@0.0.1769-pr.1793.239a9a3This exact version is immutable and reproducible. The rolling Option B — Download artifact
tar xzf billion-context-pr1793.tgz
npm install -g packageInstall instructions are refreshed on each push. |
The pre-PR comment said the full grace default would outlast the 5s waitFor cap — true then (grace 5s == cap 5s). After the cap moved to POLL_DEADLINE_MS = 15000 that inequality no longer holds (5s < 15s); the pin's real job is keeping each legacy dead-attach suite from sitting out the full grace window so the cap dominates timing.
[bot] 🏷 Review 完成。结论:可合并(merge 由人执行)。 结构化七问:
Review 期间的额外工作(披露):发现 PR 新增 header 注释里 grace-pin 的理由「(it would outlast the POLL_DEADLINE_MS cap and race it)」不成立——grace 默认 5s < 新 cap 15s,不存在「outlast」;pin 的真实作用是防止 legacy dead-attach 用例坐满整个 grace 窗口。按「小问题直接修」就地修正:commit Pre-flight 复核(pr head 本地):typecheck clean / tsup build OK / 判定:可合并。 测试单文件、base 最新、无热文件冲突、断言有牙未失、flake 属预存在且单独跟踪(#1791)。请人工合并:#1793 |
What & why
tests/dsh-native.test.tsgates async tool-registration behind a FIXED wall-clock poll deadline (waitForat ~line 413, plus two inline attach loops at ~line 1386 / ~line 1433). On a heavily loaded dev host (CPU/event-loop starvation) a real loopback manifest round-trip can exceed 5s wall-clock, tripping uniform ≈5.0–5.1s timeout failures across the attach cluster (one #1130 case + five #1365 cases) even though the same code passes in CI and on a light host. Root-caused in #1785.Centralize the budget in
POLL_DEADLINE_MS = 15000and apply it to all three sites. Fast CI (sub-second) is unaffected; a genuine hang still fails, just later.Scope / behavior
tests/dsh-native.test.ts(1 file, +11/−8). No product/wire/config/persistence impact.Pre-flight
tsc --noEmit --project tsconfig.build.json): cleannode --import tsx --test tests/dsh-native.test.ts: green on clean master AND with this change (see note below re: pre-existing flakes)Note for reviewers / CI
While verifying I observed pre-existing intermittent flakes unrelated to this change —
#983 maybeRetry self-heals a base-less register after a failed respawn(fast ~95ms, non-timeout) and#956 apply() runtime-info: a mid-resolve model switch discards the stale resolverotate across runs and also appear on current master's windows/22 CI. A red dsh-native job on this PR may be one of those rather than this diff. Tracked separately: #1791.Closes #1785
Related: #1791