From 6aa9c338c4cc3a6585ea2c5e340cabb9514c14e9 Mon Sep 17 00:00:00 2001 From: Russell Clarey Date: Thu, 6 Aug 2026 10:38:33 +0200 Subject: [PATCH] increase timeout --- .../src/test/e2e/run_notebooks_ipynb.e2e.ts | 5 ++- .../src/test/e2e/run_notebooks_py.e2e.ts | 4 ++- .../src/test/e2e/utils/commonUtils.ts | 31 +++++++++++++------ 3 files changed, 29 insertions(+), 11 deletions(-) diff --git a/packages/databricks-vscode/src/test/e2e/run_notebooks_ipynb.e2e.ts b/packages/databricks-vscode/src/test/e2e/run_notebooks_ipynb.e2e.ts index ce370311a..e28baf125 100644 --- a/packages/databricks-vscode/src/test/e2e/run_notebooks_ipynb.e2e.ts +++ b/packages/databricks-vscode/src/test/e2e/run_notebooks_ipynb.e2e.ts @@ -17,7 +17,10 @@ import { // likely because the tests open webviews which are heavy on resources. describe("Run ipynb notebooks", async function () { let projectDir: string; - this.timeout(3 * 60 * 1000); + // Waiting for the command to register, the webview to open and the job to + // succeed can each take up to a minute or more on the Windows shard, so the + // per-test budget has to be larger than the sum of those waits. + this.timeout(6 * 60 * 1000); before(async () => { assert(process.env.WORKSPACE_PATH); diff --git a/packages/databricks-vscode/src/test/e2e/run_notebooks_py.e2e.ts b/packages/databricks-vscode/src/test/e2e/run_notebooks_py.e2e.ts index 8bb4d0f48..5b1ac56c1 100644 --- a/packages/databricks-vscode/src/test/e2e/run_notebooks_py.e2e.ts +++ b/packages/databricks-vscode/src/test/e2e/run_notebooks_py.e2e.ts @@ -17,7 +17,9 @@ import { // likely because the tests open webviews which are heavy on resources. describe("Run py notebooks", async function () { let projectDir: string; - this.timeout(3 * 60 * 1000); + // See the matching comment in run_notebooks_ipynb.e2e.ts: the same waits + // apply here, so this suite needs the same larger per-test budget. + this.timeout(6 * 60 * 1000); before(async () => { assert(process.env.WORKSPACE_PATH); diff --git a/packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts b/packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts index 71ac38e3b..3e5734780 100644 --- a/packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts +++ b/packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts @@ -381,17 +381,30 @@ export async function openFile(fileName: string) { }); } -export async function executeCommandWhenAvailable(command: string) { +export async function executeCommandWhenAvailable( + command: string, + timeoutMs = 60_000 +) { const workbench = await driver.getWorkbench(); - return browser.waitUntil(async () => { - try { - await workbench.executeQuickPick(command); - return true; - } catch (e) { - console.log(`Failed to execute ${command}:`, e); - return false; + // Each failed attempt spends several seconds in the quick pick before + // throwing "Command not found", so the default 10s waitforTimeout only + // allows two tries. That is not enough on the Windows shard, where the + // extension can still be activating when the test starts. + return browser.waitUntil( + async () => { + try { + await workbench.executeQuickPick(command); + return true; + } catch (e) { + console.log(`Failed to execute ${command}:`, e); + return false; + } + }, + { + timeout: timeoutMs, + timeoutMsg: `Command "${command}" did not become available`, } - }); + ); } export async function waitForNotification(