From 6b5c74aa4baaac2b43da73250e9e8e30f68aafa5 Mon Sep 17 00:00:00 2001 From: Tam Nhu Tran Date: Wed, 22 Apr 2026 16:42:45 -0400 Subject: [PATCH] perf(test-bucket): only serialize slow bucket, parallelize fast MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer noted `--max-concurrency=1` was applied to both buckets. Slow bucket needs it (subprocesses, ports, shared state → flaky in parallel) but fast bucket was unnecessarily capped. Remove the flag for fast; keep for slow. Verified: test:fast still green (2510 pass, 14.4s locally). --- scripts/run-test-bucket.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scripts/run-test-bucket.js b/scripts/run-test-bucket.js index 52981bac..adca8e60 100644 --- a/scripts/run-test-bucket.js +++ b/scripts/run-test-bucket.js @@ -125,15 +125,18 @@ function runBucket(name) { } } - const result = spawnSync( - 'bun', - ['test', '--max-concurrency=1', ...selected], - { - cwd: rootDir, - stdio: 'inherit', - shell: process.platform === 'win32', - }, - ); + // Slow bucket forces sequential execution because it spawns subprocesses, + // binds ports, and touches shared state — parallelism causes flakes. + // Fast bucket keeps bun's default parallelism for speed. + const bunArgs = name === 'slow' + ? ['test', '--max-concurrency=1', ...selected] + : ['test', ...selected]; + + const result = spawnSync('bun', bunArgs, { + cwd: rootDir, + stdio: 'inherit', + shell: process.platform === 'win32', + }); return result.status ?? 1; }