From b830dcdd6fcb35a0872e53035d8e20e196a27f27 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 29 Oct 2024 18:33:57 +0000 Subject: [PATCH 1/8] tweak timeouts --- site/e2e/playwright.config.ts | 3 ++- site/e2e/tests/app.spec.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/site/e2e/playwright.config.ts b/site/e2e/playwright.config.ts index 7042ebfcf5bb6..5d88f43ee9cac 100644 --- a/site/e2e/playwright.config.ts +++ b/site/e2e/playwright.config.ts @@ -65,7 +65,7 @@ export default defineConfig({ testMatch: /.*\.spec\.ts/, dependencies: ["testsSetup"], use: { storageState }, - timeout: 50_000, + timeout: 30_000, }, ], reporter: [["./reporter.ts"]], @@ -88,6 +88,7 @@ export default defineConfig({ args: ["--disable-webgl"], }, }), + actionTimeout: 5000, }, webServer: { url: `http://localhost:${coderPort}/api/v2/deployment/config`, diff --git a/site/e2e/tests/app.spec.ts b/site/e2e/tests/app.spec.ts index bf127ce9f21b7..8b4319b70452f 100644 --- a/site/e2e/tests/app.spec.ts +++ b/site/e2e/tests/app.spec.ts @@ -13,6 +13,8 @@ import { beforeCoderTest } from "../hooks"; test.beforeEach(({ page }) => beforeCoderTest(page)); test("app", async ({ context, page }) => { + test.setTimeout(75000); + const appContent = "Hello World"; const token = randomUUID(); const srv = http From 058a6f9701c5f6fbd098026fdae80bbc77afdd1f Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 29 Oct 2024 18:48:43 +0000 Subject: [PATCH 2/8] big timeouts --- site/e2e/helpers.ts | 2 +- site/e2e/tests/app.spec.ts | 4 ++-- site/e2e/tests/outdatedAgent.spec.ts | 2 +- site/e2e/tests/outdatedCLI.spec.ts | 2 ++ site/e2e/tests/webTerminal.spec.ts | 2 ++ 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/site/e2e/helpers.ts b/site/e2e/helpers.ts index fd436fa5dad7f..f825baa3172c1 100644 --- a/site/e2e/helpers.ts +++ b/site/e2e/helpers.ts @@ -928,7 +928,7 @@ export async function openTerminalWindow( ): Promise { // Wait for the web terminal to open in a new tab const pagePromise = context.waitForEvent("page"); - await page.getByTestId("terminal").click(); + await page.getByTestId("terminal").click({ timeout: 60_000 }); const terminal = await pagePromise; await terminal.waitForLoadState("domcontentloaded"); diff --git a/site/e2e/tests/app.spec.ts b/site/e2e/tests/app.spec.ts index 8b4319b70452f..9682fcb5751dc 100644 --- a/site/e2e/tests/app.spec.ts +++ b/site/e2e/tests/app.spec.ts @@ -13,7 +13,7 @@ import { beforeCoderTest } from "../hooks"; test.beforeEach(({ page }) => beforeCoderTest(page)); test("app", async ({ context, page }) => { - test.setTimeout(75000); + test.setTimeout(75_000); const appContent = "Hello World"; const token = randomUUID(); @@ -58,7 +58,7 @@ test("app", async ({ context, page }) => { // Wait for the web terminal to open in a new tab const pagePromise = context.waitForEvent("page"); - await page.getByText(appName).click(); + await page.getByText(appName).click({ timeout: 60_000 }); const app = await pagePromise; await app.waitForLoadState("domcontentloaded"); await app.getByText(appContent).isVisible(); diff --git a/site/e2e/tests/outdatedAgent.spec.ts b/site/e2e/tests/outdatedAgent.spec.ts index a4e42e62ec725..422074d92e341 100644 --- a/site/e2e/tests/outdatedAgent.spec.ts +++ b/site/e2e/tests/outdatedAgent.spec.ts @@ -17,7 +17,7 @@ const agentVersion = "v2.12.1"; test.beforeEach(({ page }) => beforeCoderTest(page)); test(`ssh with agent ${agentVersion}`, async ({ page }) => { - test.setTimeout(40_000); // This is a slow test, 20s may not be enough on Mac. + test.setTimeout(60_000); const token = randomUUID(); const template = await createTemplate(page, { diff --git a/site/e2e/tests/outdatedCLI.spec.ts b/site/e2e/tests/outdatedCLI.spec.ts index 22301483e0977..3470367c63546 100644 --- a/site/e2e/tests/outdatedCLI.spec.ts +++ b/site/e2e/tests/outdatedCLI.spec.ts @@ -17,6 +17,8 @@ const clientVersion = "v2.8.0"; test.beforeEach(({ page }) => beforeCoderTest(page)); test(`ssh with client ${clientVersion}`, async ({ page }) => { + test.setTimeout(60_000); + const token = randomUUID(); const template = await createTemplate(page, { apply: [ diff --git a/site/e2e/tests/webTerminal.spec.ts b/site/e2e/tests/webTerminal.spec.ts index 6db4363a4e360..fc6baec7daa67 100644 --- a/site/e2e/tests/webTerminal.spec.ts +++ b/site/e2e/tests/webTerminal.spec.ts @@ -12,6 +12,8 @@ import { beforeCoderTest } from "../hooks"; test.beforeEach(({ page }) => beforeCoderTest(page)); test("web terminal", async ({ context, page }) => { + test.setTimeout(75_000); + const token = randomUUID(); const template = await createTemplate(page, { apply: [ From 13628346ef8303f2368cbd34ea0445798313701c Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 29 Oct 2024 19:00:52 +0000 Subject: [PATCH 3/8] longer wait for agent status --- site/e2e/helpers.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/site/e2e/helpers.ts b/site/e2e/helpers.ts index f825baa3172c1..b29635dd10ac4 100644 --- a/site/e2e/helpers.ts +++ b/site/e2e/helpers.ts @@ -425,7 +425,9 @@ export const startAgentWithCommand = async ( ); }); - await page.getByTestId("agent-status-ready").waitFor({ state: "visible" }); + await page + .getByTestId("agent-status-ready") + .waitFor({ state: "visible", timeout: 30_000 }); return cp; }; From 601a22eae8ce15289076068658a5658555ee26f4 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 29 Oct 2024 19:35:09 +0000 Subject: [PATCH 4/8] how about red 40 --- site/e2e/helpers.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/site/e2e/helpers.ts b/site/e2e/helpers.ts index b29635dd10ac4..c5ac7f1abde65 100644 --- a/site/e2e/helpers.ts +++ b/site/e2e/helpers.ts @@ -427,7 +427,7 @@ export const startAgentWithCommand = async ( await page .getByTestId("agent-status-ready") - .waitFor({ state: "visible", timeout: 30_000 }); + .waitFor({ state: "visible", timeout: 45_000 }); return cp; }; From 87d777effd03e12a9cccf08b1abd401431d4d0f0 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 29 Oct 2024 19:43:30 +0000 Subject: [PATCH 5/8] run 1 From b7416c3b579dded441a8a556e3b91e6a3f2dfa7f Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 29 Oct 2024 19:54:27 +0000 Subject: [PATCH 6/8] run 2 From 8d3e0a1a3db9a99447dd8713969582a31bcbfc8b Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Tue, 29 Oct 2024 20:02:18 +0000 Subject: [PATCH 7/8] run 3 From 04e3d3e274f06b0c23ee463d70938c85380f9d24 Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Wed, 30 Oct 2024 00:00:44 +0000 Subject: [PATCH 8/8] thanks ben --- site/e2e/playwright.config.ts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/site/e2e/playwright.config.ts b/site/e2e/playwright.config.ts index 5d88f43ee9cac..ea55bf398e7df 100644 --- a/site/e2e/playwright.config.ts +++ b/site/e2e/playwright.config.ts @@ -70,11 +70,7 @@ export default defineConfig({ ], reporter: [["./reporter.ts"]], use: { - // It'd be very nice to add this, but there are some tests that need - // tweaking to make it work consistently (notably, ones that wait for agent - // stats on the workspace page. The default is like 50 seconds, which is - // way too long and makes it painful to wait for test runs in CI. - // actionTimeout: 5000, // 5 seconds + actionTimeout: 5000, baseURL: `http://localhost:${coderPort}`, video: "retain-on-failure", ...(wsEndpoint @@ -88,7 +84,6 @@ export default defineConfig({ args: ["--disable-webgl"], }, }), - actionTimeout: 5000, }, webServer: { url: `http://localhost:${coderPort}/api/v2/deployment/config`,