From 8a21b2a1e7545941f84ec8ef41c147913359764f Mon Sep 17 00:00:00 2001 From: hannesrudolph Date: Wed, 2 Jul 2025 15:58:17 -0600 Subject: [PATCH] fix: disable code index throttling during E2E tests to prevent timeouts --- apps/vscode-e2e/src/runTest.ts | 1 + src/services/code-index/manager.ts | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/vscode-e2e/src/runTest.ts b/apps/vscode-e2e/src/runTest.ts index 2e8b262a49..a1005eb0e7 100644 --- a/apps/vscode-e2e/src/runTest.ts +++ b/apps/vscode-e2e/src/runTest.ts @@ -30,6 +30,7 @@ async function main() { ...process.env, ...(testGrep && { TEST_GREP: testGrep }), ...(testFile && { TEST_FILE: testFile }), + VSCODE_E2E_TESTING: "true", // Flag to indicate E2E testing environment } // Download VS Code, unzip it and run the integration test diff --git a/src/services/code-index/manager.ts b/src/services/code-index/manager.ts index 9499fc0545..13bca68357 100644 --- a/src/services/code-index/manager.ts +++ b/src/services/code-index/manager.ts @@ -54,7 +54,9 @@ export class CodeIndexManager { this.context = context // Create state manager with default throttle interval (500ms) // Can be customized by passing a different value to the constructor - this._stateManager = new CodeIndexStateManager() + // In test environments, disable throttling to prevent timeouts + const throttleInterval = process.env.VSCODE_E2E_TESTING === "true" ? 0 : undefined + this._stateManager = new CodeIndexStateManager(throttleInterval) } // --- Public API ---