From 48de11ce2e5af9810fc97d1c2f89df56bf3a3d4d Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Fri, 9 Oct 2026 14:17:27 +0000 Subject: [PATCH] test(process): check malformed capture choices concurrently The malformed process-choice acceptance test spawned 26 CLI processes one after another. On CI it took 45-59 s against its 60 s deadline and timed out on unrelated PRs. Run the independent cases concurrently, each with its own scenario file; every assertion is unchanged. Co-Authored-By: Claude Opus 5.5 --- .../tools/localToolContracts.test.ts | 35 +++++++++++-------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/tests/acceptance/tools/localToolContracts.test.ts b/tests/acceptance/tools/localToolContracts.test.ts index c006786336..83634a43cd 100644 --- a/tests/acceptance/tools/localToolContracts.test.ts +++ b/tests/acceptance/tools/localToolContracts.test.ts @@ -161,21 +161,26 @@ captureTest( }), ), ]; - for (const options of invalid) { - const request = { ...scenario, ...options }; - expect( - (await call("capture_process_scenario", request)).isError, - JSON.stringify(options), - ).toBe(true); - const path = join(root, "scenario.json"); - await writeFile(path, JSON.stringify(request)); - await expect( - execute(process.execPath, [cli, "capture-process", path, "--json"]), - ).rejects.toMatchObject({ - code: 1, - stdout: expect.stringContaining("invalid_request"), - }); - } + // Each CLI case is an independent process; running them concurrently keeps + // the suite well inside its deadline on slower CI runners. + await Promise.all( + invalid.map(async (options, index) => { + const request = { ...scenario, ...options }; + expect( + (await call("capture_process_scenario", request)).isError, + JSON.stringify(options), + ).toBe(true); + const path = join(root, `scenario-${String(index)}.json`); + await writeFile(path, JSON.stringify(request)); + await expect( + execute(process.execPath, [cli, "capture-process", path, "--json"]), + JSON.stringify(options), + ).rejects.toMatchObject({ + code: 1, + stdout: expect.stringContaining("invalid_request"), + }); + }), + ); await expect(access(marker)).rejects.toMatchObject({ code: "ENOENT" }); const missing = join(root, "missing-executable"); const failed = await call("capture_process_scenario", {