Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
31 changes: 22 additions & 9 deletions packages/databricks-vscode/src/test/e2e/utils/commonUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Loading