Skip to content

Commit 95d68e0

Browse files
committed
[TE-4877] Fix broken test after Playwright upgrade
AMP LLM model told me this: In Playwright, tests use fixtures like browserName, browser, context, and page. When you set a very short timeout (1ms), the test fails during fixture setup. The newer version of Playwright now times out during the "context" fixture setup (creating the browser context) rather than the "browserName" fixture setup. This is likely because newer Playwright optimizes browser launching to be faster or lazy-loads certain operations, so the timeout now hits later in the setup chain. Playwright fixtures follow a hierarchical setup order: browserName - Simple string constant (chromium/firefox/webkit) browser - Worker-scoped; launches once per worker process (expensive operation) context - Test-scoped; creates isolated browser context (like incognito mode) per test page - Test-scoped; creates a page/tab within the context per test When you set a 1ms timeout, the test fails during fixture setup. The newer Playwright version changed where the timeout triggers—from "browserName" to "context". This suggests the browser launch (browser fixture) now completes faster or is optimized differently, so the 1ms timeout now expires during the context creation step instead of earlier in the chain.
1 parent 0b2f96b commit 95d68e0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

e2e/playwright.test.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,10 @@ describe('examples/playwright', () => {
120120
expect(data).toHaveProperty("data[0].location", "tests/example.spec.js:3:1")
121121
expect(data).toHaveProperty("data[0].file_name", "tests/example.spec.js")
122122
expect(data).toHaveProperty("data[0].result", 'failed')
123-
expect(data).toHaveProperty("data[1].failure_reason", "Test timeout of 1ms exceeded while setting up \"browserName\".")
123+
expect(data).toHaveProperty("data[1].failure_reason", "Test timeout of 1ms exceeded while setting up \"context\".")
124124
expect(data).toHaveProperty("data[1].failure_expanded", expect.arrayContaining([
125125
expect.objectContaining({
126-
expanded: expect.arrayContaining(["Test timeout of 1ms exceeded while setting up \"browserName\"."])
126+
expanded: expect.arrayContaining(["Test timeout of 1ms exceeded while setting up \"context\"."])
127127
})
128128
]))
129129

@@ -132,10 +132,10 @@ describe('examples/playwright', () => {
132132
expect(data).toHaveProperty("data[1].location", "tests/example.spec.js:9:1")
133133
expect(data).toHaveProperty("data[1].file_name", "tests/example.spec.js")
134134
expect(data).toHaveProperty("data[1].result", "failed")
135-
expect(data).toHaveProperty("data[1].failure_reason", "Test timeout of 1ms exceeded while setting up \"browserName\".")
135+
expect(data).toHaveProperty("data[1].failure_reason", "Test timeout of 1ms exceeded while setting up \"context\".")
136136
expect(data).toHaveProperty("data[1].failure_expanded", expect.arrayContaining([
137137
expect.objectContaining({
138-
expanded: expect.arrayContaining(["Test timeout of 1ms exceeded while setting up \"browserName\"."])
138+
expanded: expect.arrayContaining(["Test timeout of 1ms exceeded while setting up \"context\"."])
139139
})
140140
]))
141141
expect(stdout).toMatch(/Test Engine .* response/m)

0 commit comments

Comments
 (0)