Skip to content

[CI] Build large file-listing fixtures faster (23% less time) - #26002

Closed
nwparker wants to merge 1 commit into
nwparker/bun-test-review-followupfrom
nwparker/test-inventory-fixture-writes
Closed

nwparker wants to merge 1 commit into
nwparker/bun-test-review-followupfrom
nwparker/test-inventory-fixture-writes

Conversation

@nwparker

@nwparker nwparker commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor
Files Added Deleted Net
Test 2 $\color{#1a7f37}{\Huge{\mathbf{+}}}$​6 $\color{#cf222e}{\Huge{\mathbf{−}}}$​10 $\color{#cf222e}{\Huge{\mathbf{−}}}$​4
Prod 0 0 0 0

ELI5

Large file-listing tests create their real fixture files sooner, so the tests finish sooner.

What Changed

Replace batches of Promise-based fixture writes with synchronous writes inside the isolated test worker. Keep all 40,120 real files, identical paths and contents, the real ripgrep listing, cap/ignore assertions, and existing deadlines.

Why

The fixtures need every file before listing can start. Scheduling thousands of Promise-based writes adds work without allowing the tested operation to begin earlier. Sequential writes reduce that fixture overhead without replacing real files with mocks or shrinking the workload.

Measured on macOS arm64/M4 Max, Node 24.20.0, Bun 1.4.2, Vitest 5.0.3, two workers:

Same two files / three cases Before: Promise batches After: synchronous fixture writes Improvement
Median complete pnpm test wall time 8.2665s 6.3319s 23.40% less time; 1.31× speed
Minimum–maximum 8.2496–8.3910s 6.2061–6.7955s

Three sequential runs before, then three after, same checkout except these fixture loops; no excluded warmup. Times include command startup, fixture creation, real listing, assertions, cleanup, reporting and exit. All six passed with identical case identities and outcomes. Samples in seconds: before 8.390994, 8.249583, 8.266466; after 6.331862, 6.795455, 6.206055. These scoped timings do not establish the 2× full-suite target.

Reproduce:

ORCA_BACKGROUND_LAUNCH=1 pnpm test src/main/ipc/filesystem-quick-open-options.integration.test.ts src/relay/fs-handler-list-files-candidates.integration.test.ts --maxWorkers=2

Linked Issue

Maintainer-requested test-performance follow-up. Initially based on #25998 for its fixture typecheck repair; this PR adds only two fixture changes and will target main after that prerequisite merges.

Visual Proof

N/A — test fixture creation only; no rendered UI or interaction change.

Testing

  • I manually tested these changes locally
  • Automated test fixtures updated

macOS arm64: all six measured runs pass with identical case outcomes. All three cases also pass in the Node fallback. The changed-code quality gate and commit-time lint/format checks pass. No new tests are needed for replacing the write loop because the existing integration cases verify the complete real-file workload and listing behavior.

Review

Reviewed file counts, contents, awaited directory creation, real listing, cleanup and timeouts. Synchronous work runs only in the isolated test process. Application files, remote execution and production thread behavior are unchanged.

Agent skill upstream boundary

  • Not applicable; no upstream skill source copied.

Notes

Use Node's cross-platform file/path APIs; no platform-specific optimization or native binary change. Relay contracts retain their real execution behavior.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • Visual proof is N/A with reason
  • Self-reviewed for correctness, security, and performance
  • Cross-platform and SSH/remote impact considered
  • Relevant local checks pass; CI covers the remaining repository checks

@nwparker

nwparker commented Oct 6, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #26000 to avoid duplicate full CI runs. That PR preserves these two fixture changes and their measured 8.2665s → 6.3319s median (23.40% less time), alongside separately measured clock and exact-byte assertion improvements. This PR is closed without merging; #26000 now contains all six test files and the complete before/after evidence.

@nwparker nwparker closed this Oct 6, 2026
@nwparker nwparker changed the title Build large file-listing fixtures faster (23% less time) [CI] Build large file-listing fixtures faster (23% less time) Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant