test: reduce suite latency with safe sharding - #832
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThe PR replaces the serial default Bun test command with a supervisor that runs the suite in independent file shards while avoiding Bun’s isolated parallel-worker mode.
Confidence Score: 4/5The PR appears safe to merge, with one non-blocking repository-convention issue around direct environment-variable access. The shard orchestration has no established blocking failure, but the new supervisor bypasses the prescribed validated environment interface when reading the shard override and forwarding child environments. Files Needing Attention: scripts/run-test-suite.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant U as Caller / CI
participant R as run-test-suite.ts
participant S1 as Bun shard 1
participant S2 as Bun shard 2
U->>R: bun run test [args]
R->>R: Resolve shard count
par Launch file shards
R->>S1: "bun test --shard=1/2 patterns"
R->>S2: "bun test --shard=2/2 patterns"
end
alt Interrupt or partial launch
U-->>R: SIGINT / SIGTERM
R-->>S1: Forward signal, then SIGKILL
R-->>S2: Forward signal, then SIGKILL
else Normal completion
S1-->>R: Exit code
S2-->>R: Exit code
R-->>U: Combined success/failure status
end
Prompt To Fix All With AI### Issue 1
scripts/run-test-suite.ts:76
**Direct environment access bypasses validation**
The new supervisor reads `HUNK_TEST_SHARDS` directly from `process.env` and also spreads `process.env` into each child at line 87, bypassing the repository-prescribed type-safe environment interface and establishing an inconsistent configuration-access pattern.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "test: reduce suite latency with safe sha..." | Re-trigger Greptile |
benvinegar
force-pushed
the
perf/test-suite-sharding
branch
from
August 24, 2026 12:35
4dd64cc to
d5c2550
Compare
benvinegar
enabled auto-merge (squash)
August 24, 2026 12:36
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.
Summary
--parallelisolation path, which breaks OpenTUI native FFI initializationBenchmark
Bun 1.3.14 on Linux with the full test suite:
This reduces local wall time by about 42%. Under a simulated two-vCPU affinity, two shards reduced wall time from 46.4s to 29.3s. On Linux, higher shard counts remain available through
HUNK_TEST_SHARDS, while the automatic default stays capped at two.Validation
examplesscope: 3,030 passed, 10 skipped, zero failures, zero detached daemonsbun test scripts/run-test-suite.test.tsbun run typecheckbun run lint--no-orphansmust be omitted and daemon assertions must follow the serving child PIDThis PR description was generated by Pi using gpt-5.6-sol