Skip to content

Commit 85ff8e0

Browse files
authored
chore: tweak e2e test timeouts (coder#15275)
1 parent 371a2e1 commit 85ff8e0

File tree

6 files changed

+14
-10
lines changed

6 files changed

+14
-10
lines changed

site/e2e/helpers.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,9 @@ export const startAgentWithCommand = async (
425425
);
426426
});
427427

428-
await page.getByTestId("agent-status-ready").waitFor({ state: "visible" });
428+
await page
429+
.getByTestId("agent-status-ready")
430+
.waitFor({ state: "visible", timeout: 45_000 });
429431
return cp;
430432
};
431433

@@ -928,7 +930,7 @@ export async function openTerminalWindow(
928930
): Promise<Page> {
929931
// Wait for the web terminal to open in a new tab
930932
const pagePromise = context.waitForEvent("page");
931-
await page.getByTestId("terminal").click();
933+
await page.getByTestId("terminal").click({ timeout: 60_000 });
932934
const terminal = await pagePromise;
933935
await terminal.waitForLoadState("domcontentloaded");
934936

site/e2e/playwright.config.ts

+2-6
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,12 @@ export default defineConfig({
6565
testMatch: /.*\.spec\.ts/,
6666
dependencies: ["testsSetup"],
6767
use: { storageState },
68-
timeout: 50_000,
68+
timeout: 30_000,
6969
},
7070
],
7171
reporter: [["./reporter.ts"]],
7272
use: {
73-
// It'd be very nice to add this, but there are some tests that need
74-
// tweaking to make it work consistently (notably, ones that wait for agent
75-
// stats on the workspace page. The default is like 50 seconds, which is
76-
// way too long and makes it painful to wait for test runs in CI.
77-
// actionTimeout: 5000, // 5 seconds
73+
actionTimeout: 5000,
7874
baseURL: `http://localhost:${coderPort}`,
7975
video: "retain-on-failure",
8076
...(wsEndpoint

site/e2e/tests/app.spec.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import { beforeCoderTest } from "../hooks";
1313
test.beforeEach(({ page }) => beforeCoderTest(page));
1414

1515
test("app", async ({ context, page }) => {
16+
test.setTimeout(75_000);
17+
1618
const appContent = "Hello World";
1719
const token = randomUUID();
1820
const srv = http
@@ -56,7 +58,7 @@ test("app", async ({ context, page }) => {
5658

5759
// Wait for the web terminal to open in a new tab
5860
const pagePromise = context.waitForEvent("page");
59-
await page.getByText(appName).click();
61+
await page.getByText(appName).click({ timeout: 60_000 });
6062
const app = await pagePromise;
6163
await app.waitForLoadState("domcontentloaded");
6264
await app.getByText(appContent).isVisible();

site/e2e/tests/outdatedAgent.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const agentVersion = "v2.12.1";
1717
test.beforeEach(({ page }) => beforeCoderTest(page));
1818

1919
test(`ssh with agent ${agentVersion}`, async ({ page }) => {
20-
test.setTimeout(40_000); // This is a slow test, 20s may not be enough on Mac.
20+
test.setTimeout(60_000);
2121

2222
const token = randomUUID();
2323
const template = await createTemplate(page, {

site/e2e/tests/outdatedCLI.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ const clientVersion = "v2.8.0";
1717
test.beforeEach(({ page }) => beforeCoderTest(page));
1818

1919
test(`ssh with client ${clientVersion}`, async ({ page }) => {
20+
test.setTimeout(60_000);
21+
2022
const token = randomUUID();
2123
const template = await createTemplate(page, {
2224
apply: [

site/e2e/tests/webTerminal.spec.ts

+2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { beforeCoderTest } from "../hooks";
1212
test.beforeEach(({ page }) => beforeCoderTest(page));
1313

1414
test("web terminal", async ({ context, page }) => {
15+
test.setTimeout(75_000);
16+
1517
const token = randomUUID();
1618
const template = await createTemplate(page, {
1719
apply: [

0 commit comments

Comments
 (0)