Repository navigation
test(ui/scripts): take the dead-keys sweep's whole-repo readings once, at collection - #27437
Merged
Merged
Conversation
…, at collection The case "keeps every key it makes reachable OUT of both tiers" ran its own `sweep()` of the whole repository inside its 15 s budget and timed out on a loaded Test UI shard; two sibling cases ran `analyze()` and the indirect-head collection in-case the same way. Each real-tree reading is now taken once per file through a frozen memo, in the describe bodies, so collection pays it and no case does. Every assertion reads the same values as before. Claude-Session: https://claude.ai/code/session_01JQwxbYeSmhiCsoJFL2RkQS Co-authored-by: Claude <noreply@anthropic.com>
…I read as implicit any Claude-Session: https://claude.ai/code/session_01JQwxbYeSmhiCsoJFL2RkQS Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#2 · os-warren · session_01JQwxbXpF772qWJjojJvRXw 席位核对ACCEPT · 席位意见:p0 main-red 修复。
|
This was referenced Oct 29, 2026
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.
Requested by Warren · project thread
Fixes #27423
Clause-②: no
Metadata-protocol: none
维护者速读
check-i18n-dead-keys.test.ts里读真实仓库的四个读数(sweep、analyze、collectEnKeys、间接模板头)每个文件只算一次,在 describe 体(收集阶段)里取,三个用例不再在自己的 15 秒预算里重扫整个仓库。Test UI (10/16)在用例「keeps every key it makes reachable OUT of both tiers」超时 15 秒;同一 sha 在合并队列里是绿的,属于负载下的间歇红。按裁决不调超时、不跳过、不重试、不改断言。ui/scripts/__tests__/check-i18n-dead-keys.test.ts顶部新增的realTree备忘块,以及两个on the real tree/measured on THIS repositorydescribe 体里的取值行。pnpm --dir ui exec vitest run scripts/__tests__/check-i18n-dead-keys.test.ts,预期 146 passed,三个原慢用例各在几毫秒内完成。What changes
ui/scripts/__tests__/check-i18n-dead-keys.test.tsonly.realTreememo takes each whole-repository reading once per file:sweep(REPO_ROOT),analyze(REPO_ROOT),collectEnKeys(REPO_ROOT)andcollectIndirectTemplateHeads(REPO_ROOT, …). Each value is frozen (arrays and plain objects, recursively), so a case that sorted or spliced one in place would throw instead of leaking into the next case.the one-hop indirect template leg › on the real treeandthe applied dynamic heads are REPORTED, not filtered › measured on THIS repository) now take those values in their describe bodies, which run at collection. Three cases lose their in-case repository walks:keeps every key it makes reachable OUT of both tiers(the red one): its ownsweep(repoRoot).⛔ does NOT enrol its heads in the call-site gate’s family registry: its ownanalyze(repoRoot).reports one row per head the sweep actually applied — no head goes unreported: its ownanalyze(repoRoot)pluscollectIndirectTemplateHeads(repoRoot, collectEnKeys(repoRoot)).collectEnKeys(repoRoot).leavesreads in the second describe read the sharedpackKeysinstead.scripts/check-i18n-dead-keys.mjsis untouched: no seam was needed.Why
The ruling carried over from #27076 holds: the timeout is not raised, no case is skipped, no retry is added, and no assertion changes. The cost was the test's own, so the cost moved out of the cases.
Collection is the right home.
ui/AGENTS.md(测试纪律) puts warm-up cost at module scope because no test or hook timeout bounds it, and it rules out abeforeAll, whose 10 shookTimeoutis narrower than the 15 stestTimeout. The second describe already took itssweep(repoRoot)in its body; this PR makes both describes share that one reading. In@vitest/runner4.1.12,withTimeoutwraps test bodies and hooks only, not the suite collect path.Tests
Measured on this container (4 cores, a shared box). "Load" means four
node -e 'for(;;){}'CPU burners beside the run. Every run went throughscripts/pm/os-verify-lock.sh. Durations come from vitest's JSON reporter (per case) and itsDurationline (per file).reports one row per head…does NOT enrol…Duration(import / tests)The cold "before" run reproduces the main-red: the same case,
Error: Test timed out in 15000ms. After the change, the slowest case in the file under load is 404 ms (both control groups from the card … POSITIVE). The collection phase grows by the one extraanalyze()reading, about 7 s idle and 10 s loaded. No timeout bounds that phase. The file's total wall drops by about 12 s idle and 13.5 s loaded.The before legs ran the file restored from
HEAD~1bygit restore --source=HEAD~1, with a trap that restoresHEAD. Restore proof:git hash-object=git rev-parse HEAD:…=9c08a7b0, andgit status --porcelainis empty.Acceptance notes
ui/scripts/__tests__/check-vi-mock-inherit.test.tshas the same in-case repository-sweep shape. Idle on this box, three cases take 6.1 to 6.8 s each:puts the census in the verdict…(it spawnsnode scripts/check-vi-mock-inherit.mjsover the whole tree) and boththe sweep — every @object-ui/i18n factory inherits…cases, which each callswept()(ascan(repoRoot, …)) in-case. The file runs 29.17 s (import 7.05 s, tests 21.77 s). About 2x load would put them near the 15 s budget.Verification
Gates derived by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackat the final head. The exit codes and the--ranreconciliation are in the os-dev report on #27423.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (CI owns the lint run)main, one pull request.ui/root, so the PR carriesskip-changeset.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code