From e23ccf335f24fd2b1e130cfc4afb552e7856551c Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Mon, 20 Jul 2026 11:09:37 +0200 Subject: [PATCH 1/2] fix(test): increase Intel macOS timeout (#41851) --- tests/library/defaultbrowsercontext-2.spec.ts | 2 -- tests/library/playwright.config.ts | 2 +- tests/library/screencast.spec.ts | 1 - tests/mcp/annotate.spec.ts | 2 -- tests/mcp/test-run.spec.ts | 1 - 5 files changed, 1 insertion(+), 7 deletions(-) diff --git a/tests/library/defaultbrowsercontext-2.spec.ts b/tests/library/defaultbrowsercontext-2.spec.ts index f87f6dfaca90b..9e0fb4102dc7d 100644 --- a/tests/library/defaultbrowsercontext-2.spec.ts +++ b/tests/library/defaultbrowsercontext-2.spec.ts @@ -20,7 +20,6 @@ import fs from 'fs'; import path from 'path'; it.skip(({ mode }) => mode !== 'default', 'Remote persistent contexts are not supported'); -it.slow(({ browserName, isMac }) => browserName === 'firefox' && isMac && process.arch === 'x64', 'Persistent Firefox launches are slow on Intel macOS runners under load.'); it('should support hasTouch option', async ({ server, launchPersistent }) => { const { page } = await launchPersistent({ hasTouch: true }); @@ -148,7 +147,6 @@ it('should goto about:blank on relaunched persistent context', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/41216' }, }, async ({ browserType, createUserDataDir, browserName, isBidi }) => { it.fixme(browserName === 'firefox' && !isBidi); - it.slow(); const userDataDir = await createUserDataDir(); diff --git a/tests/library/playwright.config.ts b/tests/library/playwright.config.ts index 50993c43760fc..a9d7ff7b1b521 100644 --- a/tests/library/playwright.config.ts +++ b/tests/library/playwright.config.ts @@ -61,7 +61,7 @@ const config: Config }); test('empty video', async ({ browser }, testInfo) => { - test.slow(); const size = { width: 800, height: 800 }; const context = await browser.newContext({ viewport: size }); const page = await context.newPage(); diff --git a/tests/mcp/annotate.spec.ts b/tests/mcp/annotate.spec.ts index b63eb702ab090..ded999196d90f 100644 --- a/tests/mcp/annotate.spec.ts +++ b/tests/mcp/annotate.spec.ts @@ -228,7 +228,6 @@ test('user-initiated annotate downloads zip with feedback.md', async ({ connectT }); test('should capture annotations via show --annotate', async ({ connectToDashboard, cli, server }) => { - test.slow(); await cli('open', server.EMPTY_PAGE); const bindTitle = `--playwright-internal--${crypto.randomUUID()}`; await cli('show', { bindTitle }); @@ -495,7 +494,6 @@ test('should switch screencast to -s session on show --annotate', async ({ conne }); test('should disengage annotate mode when --annotate client disconnects', async ({ connectToDashboard, cli, childProcess, cliEnv, mcpBrowser, mcpHeadless, server }) => { - test.slow(); await cli('open', server.EMPTY_PAGE); const bindTitle = `--playwright-internal--${crypto.randomUUID()}`; await cli('show', { bindTitle }); diff --git a/tests/mcp/test-run.spec.ts b/tests/mcp/test-run.spec.ts index 58d7167dd54b5..6aaf21a24e21c 100644 --- a/tests/mcp/test-run.spec.ts +++ b/tests/mcp/test-run.spec.ts @@ -124,7 +124,6 @@ Running 2 tests using 1 worker }); test('test_run should stop when aborted', async ({ startClient }) => { - test.slow(true, 'Drives two full test-runner lifecycles (abort + restart)'); await writeFiles({ 'slow.test.ts': ` import { test } from '@playwright/test'; From 4cd8608744bf4d18c9f23578c3cf4a1cd1862b2d Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Mon, 20 Jul 2026 11:19:54 +0100 Subject: [PATCH 2/2] chore(chromium): better error message for evaluate result being collected (#41868) --- .../src/server/chromium/crExecutionContext.ts | 2 ++ tests/page/page-evaluate.spec.ts | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/packages/playwright-core/src/server/chromium/crExecutionContext.ts b/packages/playwright-core/src/server/chromium/crExecutionContext.ts index 4d31aa7e25f7c..dbdd0e9e58a82 100644 --- a/packages/playwright-core/src/server/chromium/crExecutionContext.ts +++ b/packages/playwright-core/src/server/chromium/crExecutionContext.ts @@ -104,6 +104,8 @@ function rewriteError(error: Error): Protocol.Runtime.evaluateReturnValue { throw new Error('Cannot serialize result: object reference chain is too long.'); if (error.message.includes('Object couldn\'t be returned by value')) return { result: { type: 'undefined' } }; + if (error.message.includes('Promise was collected')) + throw new Error('Resulting promise was garbage collected.'); if (error instanceof TypeError && error.message.startsWith('Converting circular structure to JSON')) rewriteErrorMessage(error, error.message + ' Are you passing a nested JSHandle?'); diff --git a/tests/page/page-evaluate.spec.ts b/tests/page/page-evaluate.spec.ts index 19166207a4da1..5b85b8dd665a5 100644 --- a/tests/page/page-evaluate.spec.ts +++ b/tests/page/page-evaluate.spec.ts @@ -889,3 +889,13 @@ it('should ignore dangerous object keys', async ({ page }) => { const result = await page.evaluate(arg => arg, input); expect(result).toEqual({ safeKey: 'safeValue' }); }); + +it('promise collected', async ({ page, browserName }) => { + it.skip(browserName !== 'chromium', 'this is a chromium-only behavior'); + + const resultPromise = page.evaluate(() => new Promise(() => {})).catch(e => e); + for (let i = 0; i < 20; i++) + await page.requestGC(); + const error = await resultPromise; + expect(error.message).toContain('Resulting promise was garbage collected'); +});