Repository navigation
test: seven suites keep their temp databases and scaffolds off the shard's shared disk (memory-backed TMPDIR) - #27379
Conversation
…MPDIR Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
…MPDIR Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
…les on a memory-backed TMPDIR Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
…elper; readings in each config Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check2 anchor(s) derived from 8 changed package(s); no hand-written page names any of them. What this run could not see
Coarse fallback — 63 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ba1cf2ea549be224cd9c7c2c975c1f42f11e9014 && git checkout ba1cf2ea549be224cd9c7c2c975c1f42f11e9014
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7e200b4a68c242afc9f7caf0289e985eff3fcac6 51e902259e987d5b89f4d339069fada235579e55 && git checkout -B drift-repro 7e200b4a68c242afc9f7caf0289e985eff3fcac6 && git merge --no-ff 51e902259e987d5b89f4d339069fada235579e55
node scripts/docs-audit/affected-docs.mjs --json 7e200b4a68c242afc9f7caf0289e985eff3fcac6 |
…mp.mjs with a declaration A package tsconfig.test.json type-checks its vitest.config.ts, where a .mts import path is TS5097. The helper follows the tsup-drop-sources-content.mjs shape: an .mjs module with a hand-written .d.mts that check:declaration-mirrors holds in step. Claude-Session: https://claude.ai/code/session_01Utp6CZiAsVSvj5E1XZbWrG Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#3 · os-bill · session_01Utp6CXc5hequf76uJfzrdK 席位核对 — ACCEPT ·
|
domain:server#3 · os-bill · session_01Utp6CXc5hequf76uJfzrdK
Requested by Bill · project thread
Fixes #27306
Clause-②: no
Metadata-protocol: none
维护者速读
scripts/vitest-memory-tmp.mjs(附.d.mts类型声明),driver-sqlite-wasm 也改读它。不动任何产品代码、用例、断言或超时。Test Core (5/8)红灯落在 create-objectstack。scripts/vitest-memory-tmp.mjs(理由与开关)、packages/create-objectstack/vitest.config.ts(与 main 红灯同形的那一包)、packages/cli/vitest.config.ts(两个 project 各自带 env)。pnpm --filter create-objectstack test,应 19 个文件全绿;在 4 个dd conv=fsync写入者旁跑同一命令,改前 2 个文件因 afterAll 超时失败,改后全绿。What changes
scripts/vitest-memory-tmp.mjs+scripts/vitest-memory-tmp.d.mts(new, the tsup-drop-sources-content.mjs shape; round 2 moved it there from a root.mts, whichtsconfig.test.jsonrefuses as TS5097):memoryBackedTmpEnv()returns{ TMPDIR: '/dev/shm' }when/dev/shmis writable and{}otherwise. It holds the rationale once. It is deliberately not a key of the shared preset, which every re-exporter inherits.test.env:create-objectstack,cli,runtime,driver-turso,driver-sql,service-packageandservice-automation.cliandruntimedeclare vitestprojects, where a root-levelenvis inert, so each project's ownenvcarries it besideOS_REGISTRY_LOG.driver-tursore-exported the preset, so it now restates the preset's one setting in its own config, the shapedriver-sqlite-wasmtook in test(driver-sqlite-wasm): run the persistence suites' temp files on /dev/shm, so a flush's fsync stops waiting on the shard's other suites #27245.driver-sqlite-wasm(the test(driver-sqlite-wasm): run the persistence suites' temp files on /dev/shm, so a flush's fsync stops waiting on the shard's other suites #27245 precedent) now reads the same helper instead of its private copy. Its behaviour is unchanged.No product source changed. No case, assertion, fixture, timeout or budget changed, and no retry was added (the #27076 ruling).
Why
os.tmpdir()readsTMPDIR, and a child process inherits it. Every database file and scaffold tree these suites write was measured to sit underos.tmpdir()(the card asked for this reading per package). So the one setting moves all of it off the runner's shared disk. On a Test Core shard, a case that fsyncs, or a hook that unlinks a tree, waits for the other suites' I/O, so its wall time measures the neighbours rather than the code.create-objectstack, stated in three parts, as the seat asked:
Test Core (5/8)) annotate onlypackages/create-objectstack … pnpm run test exited (1). Their full job logs and artifacts are served from a storage host that this cloud container's egress proxy refuses (403). The log API returns only the last 5,000 lines, and the failing segment sits near line 33,848 of 42,326.dd conv=fsyncwriters, all 301 cases passed while two FILES failed withHook timed out in 10000ms. The timeouts were in theafterAllthat removes the scaffolded tree (created-summary.test.ts:134,scaffold-skills-single-copy.test.ts:289). That gives a red package with no failed test named, which is the shape of the annotation.strace -f -cover the whole suite counted 4 fsync, 4,018 unlink and 6,202 rmdir calls. The scaffolds' creation and removal is what waits on the loaded disk. The same isolation fixes it, because every path is underos.tmpdir().For the other packages, the mechanism is SQLite durability I/O. Under strace, one
clifile (organization-ownership-apply.generation-1.test.ts) made 3,388 fsync calls. Oneruntimefile (package-revert-stored-members.integration.test.ts) made 784 fsync and 982 unlink calls, the second being SQLite's per-transaction journal deletes.Tests
Each package was measured three ways on the same files: idle on the base, beside four
dd if=/dev/zero bs=1M count=256 conv=fsyncwriters on the same disk on the base, and beside the same writers on the head. All runs were on treeobjectstack@6d7634a9(base) and this branch (head), in a 4 vCPU cloud container with/on/dev/vdaand/dev/shmon tmpfs, usingvitest run --maxWorkers=2. Four synthetic writers are a stress, not a replay of a shard, so a red here means "exposed", not "will go red". The absolute seconds are shared-box readings.create-objectstack(all 19)cli(the 15organization-ownership-*files)runtime(51 files using SQLite underos.tmpdir())driver-turso(14 files usingos.tmpdir())driver-sql(23 files usingos.tmpdir())service-package(2 files)service-automation(4 files)Every failure under load on the base is
Test timed outorHook timed out. None is an assertion failure, and none fails idle.service-packageandservice-automationstayed green in this load run (the card's survey had 5 of 11 and 1 of 8 failing). They are treated because the card lists them as exposed and the readings put them at 61% and 87% of budget for no change in code.Full package suites on the head: each affected package's own suite, idle, on the final head
110f05aa(after mergingorigin/main), unless noted:cliunit layer (vitest run --project unit): 346/346 files, 5,032/5,032 tests. The integration layer is CI's; its 14 measuredorganization-ownership-*integration files are in the table above.runtime(pnpm test): 471 files, 7,668 passed and 19 skipped.fb2d18d7, before the merge ofmain, which touched no file of these five:driver-turso95 files, 2,492 passed and 34 skipped;driver-sql236 files passed and 12 skipped, 3,847 tests passed and 214 skipped;service-package10/10 files, 127/127;service-automation217/217 files, 2,768/2,768;create-objectstack19/19 files, 301/301;driver-sqlite-wasm39/39 files, 746/746.Acceptance notes
service-print(the card's Chromium-profile exception) and the other fsyncing packages in the card's survey (dogfood,plugin-auth,verify,service-datasource,plugin-security,plugin-pinyin-search,rest) are not touched. The card's own table measured the last four of those green under load, anddogfood,verifyandrestwere not in its exposure table.clitests deliberately scaffold underpackages/cli/node_modules/…orpackages/cli/tmp(they need the workspace's module resolution) and are not moved byTMPDIR. They were not in the measured failing family, and this PR leaves them alone.pm-orders/server/evidence/27076/fsync-survey.md) was not reachable from this account, so every reading above was re-measured here.files.Check Changesetreports whatever it reports, and the seat decides on the label.Verification
All on the final head
110f05aa.Derived gate families: 45 derived, 45 run, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 45 families from the 9 changed paths. Each was run and its exit code recorded, then reconciled with--ran:✓ dispatch-gates --ran: 45 derived famil(ies) accounted for — 45 run, 0 NOT-MEASURED. Two notes.check-plugin-teardown-shape.mjs --self-testfirst exited 3 on a shallow clone (its pinned fixture commit was unreachable) and exited 0 aftergit fetch --unshallow.check:dts-closureandcheck:dual-build-cjs-loadsread built output, so they were run after a fullturbo run build.Lint
eslint --no-inline-configover the nine touched files: exit 0. The repo-widepnpm lintis CI's.How the load was made
Four loops of
dd if=/dev/zero of=FILE bs=1M count=256 conv=fsyncon the same disk as/tmp, started 3 s before the suite and stopped after it. Each base/head pair used the same file list and--maxWorkers=2. The per-file and per-case durations come from vitest's JSON reporter.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (eslint on the nine touched files, exit 0; the repo-wide run is CI's)main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code