Skip to content

fix(cloud-connection): align the marketplace seed test's timeout with its sibling (#3785) - #4217

Merged
os-zhuang merged 1 commit into
mainfrom
claude/plugin-ordering-convention-t9ylrz
Jul 30, 2026
Merged

fix(cloud-connection): align the marketplace seed test's timeout with its sibling (#3785)#4217
os-zhuang merged 1 commit into
mainfrom
claude/plugin-ordering-convention-t9ylrz

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

收尾 #3785 的后一半(前一半 plugin-audit 已由 #4193 修复)。

诊断

marketplace-install-local-state-machine-exempt.test.ts 在整仓 pnpm test 下失败(30076ms 超时),单独跑该包必过(12 文件 / 64 用例)。

根因与兄弟用例同源:两个用例都驱动 MarketplaceInstallLocalPlugin,而它的播种路径上有两处 await import('@objectstack/runtime')recordSeedSummarymergeSeedDatasetsIntoKernel,故意不 mock)。这笔冷导入本身就要数秒,在全并行 turbo 下要吃掉数倍,且会被记到第一个触发它的用例头上。

兄弟用例 marketplace-install-local-seed-lookup.test.ts 早就被诊断过并修好了,注释原文:"an import stall, not a hang",预算提到 120s。本文件被落下,仍是 30s,于是继续以同样方式 flaky。本 PR 把预算对齐,并把理由写在本地,而不是只存在于兄弟文件里。

为什么恰好是这两个用例

flaky 集合正好等于 {不 mock runtime} ∩ {真正驱动播种}

测试 mock runtime 驱动播种 预算
conflictbundle —— 根本走不到那两处 import 默认
reseedheal 默认
seed-lookup 120s(已有)
state-machine-exempt 120s(本 PR)

所以 #3785 记录的那两个用例,正是全仓仅有的两个会撞上这条路径的;其余四个各有各的免疫理由,没有第三处需要同样处理

为什么判定是预算不足而非竞态

⚠️ 需要如实说明一处:15.7s 低于原来的 30s 预算,所以这一次运行即使不改也会通过——单次通过并不构成修复有效的证明。真正的论据是比例:一个在负载下典型耗时 ~15s、且已被观测到超过 30s 的成本,不可能安全地住在 30s 预算里(抖动 2 倍以上)。120s 与兄弟对齐,同时保证真正的 hang 仍然会失败,只是晚一些。

验证

  • 整仓 pnpm test132/132 任务成功,退出码 0(退出码直接捕获,未走管道)。

🤖 Generated with Claude Code

https://claude.ai/code/session_014DQuJBNpwStpJvo3owBw2B


Generated by Claude Code

… its sibling (#3785)

marketplace-install-local-state-machine-exempt.test.ts failed under a
full-repo `pnpm test` at 30s while passing every time the package ran
alone.

Both marketplace seed tests drive MarketplaceInstallLocalPlugin, whose
seeding path dynamically imports the real @objectstack/runtime (unmocked
on purpose, in both recordSeedSummary and mergeSeedDatasetsIntoKernel).
That cold import costs seconds by itself and multiples of that under a
fully parallel turbo run, and it is charged to whichever test triggers
it first.

The sibling marketplace-install-local-seed-lookup.test.ts was diagnosed
as exactly this — "an import stall, not a hang" — and raised to 120s.
This file was left at 30s and kept flaking the same way. The budget is
now aligned, with the rationale stated locally instead of only in the
sibling.

The flaky set is exactly the intersection of "does not mock
@objectstack/runtime" and "actually drives seeding":

  conflict, bundle        no mock, but never reach the import  default
  reseed, heal            mock the module                      default
  seed-lookup             no mock, seeds                       120s (already)
  state-machine-exempt    no mock, seeds                       120s (here)

So the two tests #3785 recorded are the only two that can hit this, and
no other file needs the same treatment.

Evidence this is a budget shortfall and not a race: the assertion passes
(no missing seed rows), and under the same full-parallel load that
produced the 30076ms failure the test now completes in 15696ms. Note
that single pass alone does not prove the fix — 15.7s would have fit
the old budget too. The argument is the ratio: a cost whose typical
value is ~15s under load, and which has been observed above 30s, cannot
live inside a 30s budget. 120s matches the sibling and leaves a genuine
hang detectable, just later.

Refs #3785

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014DQuJBNpwStpJvo3owBw2B
@vercel

vercel Bot commented Jul 30, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
objectstack Ignored Ignored Jul 30, 2026 4:19pm

Request Review

@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

No hand-written docs reference the 0 changed package(s). ✅

@os-zhuang
os-zhuang marked this pull request as ready for review July 30, 2026 16:35
@os-zhuang
os-zhuang merged commit ac1cc8c into main Jul 30, 2026
17 checks passed
@os-zhuang
os-zhuang deleted the claude/plugin-ordering-convention-t9ylrz branch July 30, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s tests tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants