Skip to content

[finding] @objectstack/cli's test suite costs ~2.8× the per-test-file norm, and on its own exceeds #4859's Test Core shard budget #10152

Description

@os-elon

Observational finding from the #10149 / #10056 measurement (PR #10151). Filed unassigned, no labels — left for triage to grade. Not a claim that anything is broken: the suite passes, and this is a cost measurement.

What was measured

Per-package suite durations read out of the turbo task groups in merge_group CI job logs, against each package's test-file count in the same tree (the count is what scripts/partition-test-shards.mjs uses as its shard weight):

packagetest filesmeasured durations/file
@objectstack/cli135548.6s (run 32352993803) / 474.4s (run 32233301407)3.5–4.1
@objectstack/spec414496.4s1.20
@objectstack/service-automation83118.9s1.43
@objectstack/driver-turso3953.5s1.37
@objectstack/client2434.7s1.45
@objectstack/example-showcase2121.6s1.03

Every other package measured lands in a ~1.0–1.45 s/file band. @objectstack/cli sits at 3.5–4.1 — roughly 2.8× the norm — in two independent runs a day apart.

For scale: at 135 files it is 5.7% of the workspace's 2348 test files, and it consumed 548.6s of a 987s (16m27s) Test Core shard — 56% of that shard's wall-clock.

Why it is worth a card of its own

Two reasons, both independent of how #10149 is decided:

  1. It is the single largest lever on the Test Core critical path. Sharding is by package, so a shard can never finish faster than its heaviest package. @objectstack/cli at 548s (9m09s) already exceeds ci: merge queue 吞吐优化——Test Core / Dogfood 各 2→3 分片 + 队列失败自动分诊评论 #4859's Test Core 最慢分片 ≤ ~7min acceptance threshold by itself — no shard count and no weight function changes that. (@objectstack/spec at 496s / 8m16s is the other one over the line, but at 414 files its per-file cost is normal; it is big, not slow.)
  2. The per-file outlier is the interesting part. The partitioner's weight proxy assumes wall-clock is dominated by fixed per-file cost (module-graph re-execution per file under isolation). That assumption holds within ~±20% across every other package measured. Whatever makes cli's files ~2.8× more expensive is a property of that suite, not of the sharding — likely worth understanding before anyone re-weights around it.

Not investigated here: why. Candidates worth a look are per-file module-graph size (cli pulls a wide dependency closure), process/fixture setup per file, and real subprocess or filesystem work in the suite. The vitest summary lines in the job logs break Duration into transform / import / tests, which is the cheapest next measurement.

Method

Durations come from the vitest summary inside each turbo task group in the queue-build job logs, read via the GitHub Actions API; test-file counts come from re-running countTestFiles() (scripts/partition-test-shards.mjs) over the same tree. Sample is small — 6 packages with usable per-package output across 3 merge_group runs (2026-08-19 / 2026-08-20), because a job log exposes only its last ~5000 lines and so only the tasks that finished last. The cli figure is the one measured twice.

Refs

Generated by Claude Code

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions