Repository navigation
test(cli): speed up the os migrate test family and budget its spawn floors - #28610
Merged
Merged
Conversation
apply.remote-posture's stderr spy now fires its write callback, so each command's exitOneShotCommand drain no longer waits out its 2 s timeout. The two os migrate meta spawners run bin/run-dev.js under this process's node instead of the tsx binary, as the rest of the family does. Files whose floor is distinct spawns or boots take a line-2 test-budget header from their slowest reading over five scheduled CI runs. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pgVXsp3aShmRuEpgc
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pgVXsp3aShmRuEpgc
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5pgVXsp3aShmRuEpgc
Contributor
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 0 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 0 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
Contributor
Author
|
domain:server#1 · os-project-manager · session_01R1q2xdtYgU6FKrZ7LgjPCC 席位核对 · ACCEPT ·
|
| item | reading |
|---|---|
| Shape | Draft, base main, Part of #23181. Exactly slice 24's eight os migrate family test files, labels tests + skip-changeset. Clause-②: no, Metadata-protocol: none. |
| Diff check (seat) | apply.remote-posture: the stderr spy now fires the write callback as the stdout spy already did, so exitOneShotCommand no longer waits out its 2 s drain timeout per run; the stream is still discarded and nothing it asserts reads stderr. migrate-meta-default-range and migrate-meta-engine-guidance spawn bin/run-dev.js on process.execPath instead of the tsx binary (slice 12's lever), argv, cwd, maxBuffer and childEnv unchanged. Line-2 // test-budget: headers on the other seven files (40/80/30/50/50/30/60), each from its CI reading; engine-guidance takes none. No assertion changes, no shared helper touched, no timeout raised. |
| Evidence | CI green on head 90445cc3 (35 success, 18 skipped, 0 failed). Mergeable state clean. Governed check: NOT governed, 36 changed lines. The report gives 52 of 52 derived gates exit 0 on the merged head and local A/B of 34.5 → 11.8 s (remote-posture), 28.0 → 16.8 s and 7.1 → 4.2 s (the two meta files). |
| Landing | 「按照 pm-dispatch 规则复核过的都授权」 (Leehom, 2026-10-25T11:35Z): ready and auto-merge through the relay, once every check on this head is green or an expected skip. |
Generated by Claude Code
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 Leehom · project thread
Part of #23181 (slice 24, the
os migratefamily). The card stays open: slices 25 to 28 take other files from slice 23's offender table.Clause-②: no
Metadata-protocol: none
维护者速读
packages/cli里 8 个os migrate测试文件。apply.remote-posture的 stderr 桩改为回调写入回调,每次命令运行不再白等 2 s;两个os migrate meta文件改用本进程的 node 跑bin/run-dev.js,不再经 tsx 二进制;6 个地板是真实 spawn/boot 的文件各加一行第 2 行// test-budget:头。files[]只有 dist、README、CHANGELOG);没有删、没有放宽任何断言,没有改超时、层级或项目;回滚即 revert。packages/cli/src/commands/migrate/apply.remote-posture.test.ts(stderr 桩,约 141 行);packages/cli/test/migrate-meta-default-range.test.ts(spawn 入口);其余只加了头。pnpm --filter @objectstack/cli exec vitest run src/commands/migrate/apply.remote-posture.test.ts→ 12/12 通过,本地约 12 s(改前约 34 s)。What changes
The eight files are slice 23's offender rows for the
os migratefamily. Readings are the default reporter's per-file module line in the Test Core shard logs of the five scheduledci.ymlruns41199450735,41217827347,41237094739,41255489006,41271604267(table:pm-orders/server/evidence/23181-s23/offenders-after-s23.mdin the project files).Cause, per file. I counted spawns, boots and distinct (command, flags, fixture) triples in each file, then timed it locally.
migrate/plan.boot-parity.integrationmigrate plan --json, per app shape)test/migrate-meta-default-rangemigrate metaspawns, already run once each and sharedtsxbinary (about 7 s locally)process.execPath; header 60migrate/plan.nullable-tenant-columns.integrationmigrate planspawnsmigrate/resume.recorded-by.integrationos serveboots, 7 in-processmigrate resumeboots, all in onebeforeAllmigrate/apply.remote-postureexitOneShotCommandwaited out its 2 s drain timeout on every runutils/schema-migrate.one-shot-family.integrationmigrate/plan.deferred-reads.integrationmigrate planspawns (human,--json)test/migrate-meta-engine-guidancemigrate metaspawn, shared by every casetsxbinaryprocess.execPath; no header (about 4 s locally)apply.remote-posture. Both commands end inexitOneShotCommand(src/utils/one-shot-exit.ts), which writes an empty chunk to stdout and stderr and waits for each callback, up to 2 s. The file's stdout spy already called back; its stderr spy returnedtrueand dropped the callback, so every run waited 2 s (most one-run cases read 2.02 to 2.05 s locally, each two-run case about 4.05 s). The stderr spy now calls back the same way the stdout spy does, and stderr output is still discarded. What is left is the beforeAll's import of the apply and plan graph and the first oclif config load (the first case reads about 4.3 s), so the file takes awhole-package importheader from its slowest CI reading on the old shape.migrate metafiles now spawnbin/run-dev.jswithprocess.execPath, as the rest of the family has since slice 12 (plan.boot-parity,object-scope,unmapped-columns). The entry,src/and the pinnedNODE_ENV=developmentare the same; thetsxwrapper only added a second process and its own transform. The files stay in theintegrationtier by behaviour (vitest-tiers.tsstill seeschild_processplusrun-dev.js).default-rangekeeps 4 distinct spawns, so it still takes a header from its CI reading on the tsx shape.spawns the real producer once per single-cause fixturefor the spawn and boot files,whole-package importforapply.remote-posture. All six parse withreadTestBudget(scripts/measure-test-shard-timings.mjs) at line 2.Not changed: no assertion, case name, timeout, tier or project. No source file, and no shared test helper (
childEnvfromtest/helpers/serve-process.tsis only called, as before).Tests
A/B (one box, one lock hold, base copied beside head as
zzbase.*, interleaved and alternating order, N=3,--maxWorkers=1, default reporter file line; copies deleted before the gate run):apply.remote-posturemigrate-meta-default-rangemigrate-meta-engine-guidanceEvery run exit 0, same test counts on both sides (12, 8 with 1 skipped, 3).
Header-only files, run once on base (header lines are comments):
plan.boot-parity3/3 (34.3 s),plan.nullable-tenant-columns1/1 (23.2 s),resume.recorded-by9/9 (27.2 s),schema-migrate.one-shot-family129/129 (11.8 s),plan.deferred-reads2/2 (10.3 s).All eight on head, after merging
origin/main(slice 23 landed as617dcf43): head90445cc3, onevitest run --maxWorkers=1 --reporter=defaultover the eight files, Test Files 8/8, Tests 166 passed and 1 skipped (the registry-selectedskipIfcase, skipped on base too). File lines: boot-parity 37.1 s, resume 24.4 s, nullable 24.5 s, default-range 18.3 s, one-shot-family 14.5 s, deferred-reads 12.7 s, engine-guidance 4.8 s, remote-posture 8.6 s (the gate sweep ran beside it on the same cores).pnpm --filter @objectstack/cli typecheck(tsc pluscheck:test-typecheck) exit 0 one6ea56ec, withNODE_OPTIONS=--max-old-space-size=4096. The merge brought no change topackages/cli's test layer.No ablation: no tested behaviour changed (test-only).
Acceptance notes
skip-changeset. Test-only.@objectstack/cli'sfiles[]isdist,README.md,CHANGELOG.md, and its build emits no test file intodist/, so nofiles[]content changes.migrate-meta-engine-guidancetakes no header. After the entry change it reads about 4 s locally, and its slowest CI reading on the tsx shape was 12.0 s (base locally about 7 s), so it should land under 10 s. If the next scheduled reading still puts it over, its floor is one real spawn and it takes a header then.apply.remote-postureshould now read well under its header. The header uses the old-shape CI reading (the rule is CI readings, never local ones); a shard-timings refresh re-sizes it.Verification
All gate readings on head
90445cc3(the merge oforigin/maininto this branch's two commits), afterpnpm exec turbo run build --concurrency=2(118/118 tasks).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack→ 52 families (the same 52 as before the merge), each run with its exit code captured before any pipe: 52 exit 0.--ranreconciliation:✓ dispatch-gates --ran: 52 derived famil(ies) accounted for — 52 run, 0 NOT-MEASURED. On the pre-merge heade6ea56ecthree first reads were container prerequisites and were re-read after meeting them:check-plugin-teardown-shape --self-testexit 3 (shallow clone) →git fetch --depth=1of its control commit → exit 0;check:dual-build-cjs-loadsandcheck:i18n-coverageexit 3 (no full build) → full build → both exit 0.pnpm exec eslint --no-inline-configover the eight files exit 0 (@objectstack/clihas nolintscript; the repo-widepnpm lintis CI's);node scripts/check-commit-card-trailers.mjs --range origin/main..HEADexit 0 (3 commits).🤖 Generated with Claude Code
https://claude.ai/code/session_01FEkQ5pgVXsp3aShmRuEpgc