moon icon indicating copy to clipboard operation
moon copied to clipboard

[BUG] Error: Playwright connection closed with wait_for_timeout(60000+)

Open MGmotor opened this issue 2 years ago • 0 comments

Context: Playwright Version: [1.27.0+] Operating System: [Linux] Python version: [3.8] Browser: [Chromium, Chrome] (with firefox all good)

Example:

from playwright.sync_api import sync_playwright

with sync_playwright() as p:
    browser = p.chromium.connect(ws_endpoint="ws://***/playwright/chrome/playwright-1.27.0")
    page = browser.new_page()
    page.goto("http://playwright.dev")
    print("before timeout")
    print(page.title())
    page.wait_for_timeout(70000)
    print("after timeout")
    print(page.title())
    browser.close()

After this i get:

before timeout
Fast and reliable end-to-end testing for modern web apps | Playwright

and then:

  File "/playwright/sync_api/_generated.py", line 10285, in wait_for_timeout
    self._sync(self._impl_obj.wait_for_timeout(timeout=timeout))
  File "/playwright/_impl/_sync_base.py", line 104, in _sync
    return task.result()
  File "/playwright/_impl/_page.py", line 923, in wait_for_timeout
    await self._main_frame.wait_for_timeout(timeout)
  File "/playwright/_impl/_frame.py", line 740, in wait_for_timeout
    await self._channel.send("waitForTimeout", locals_to_params(locals()))
  File "/playwright/_impl/_connection.py", line 43, in send
    return await self._connection.wrap_api_call(
  File "/playwright/_impl/_connection.py", line 396, in wrap_api_call
    return await cb()
  File "/playwright/_impl/_connection.py", line 78, in inner_send
    result = next(iter(done)).result()
playwright._impl._api_types.Error: Playwright connection closed

MGmotor avatar Dec 30 '22 08:12 MGmotor