From 3154c06dc35ac65bb8fb2682becc96618963318c Mon Sep 17 00:00:00 2001 From: Abhi <43648792+abhipatel12@users.noreply.github.com> Date: Tue, 11 Nov 2025 13:50:17 -0500 Subject: [PATCH] fix(ci): pre-download ripgrep in global setup to prevent race conditions (#12886) --- integration-tests/globalSetup.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/integration-tests/globalSetup.ts b/integration-tests/globalSetup.ts index 189d15f188..503e528c47 100644 --- a/integration-tests/globalSetup.ts +++ b/integration-tests/globalSetup.ts @@ -12,6 +12,7 @@ if (process.env['NO_COLOR'] !== undefined) { import { mkdir, readdir, rm } from 'node:fs/promises'; import { join, dirname } from 'node:path'; import { fileURLToPath } from 'node:url'; +import { canUseRipgrep } from '../packages/core/src/tools/ripGrep.js'; const __dirname = dirname(fileURLToPath(import.meta.url)); const rootDir = join(__dirname, '..'); @@ -32,6 +33,12 @@ export async function setup() { // construct the path before the HOME env var is set. process.env['GEMINI_CONFIG_DIR'] = join(runDir, '.gemini'); + // Download ripgrep to avoid race conditions in parallel tests + const available = await canUseRipgrep(); + if (!available) { + throw new Error('Failed to download ripgrep binary'); + } + // Clean up old test runs, but keep the latest few for debugging try { const testRuns = await readdir(integrationTestsDir);