New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use WebDriver BiDi for Chrome #17961
Comments
I've a wip locally to use Bidi with chrome. |
Nice; I hope it fixes this issue too then. If not, then puppeteer/puppeteer#12111 is pretty clever because I hadn't thought of using the demo viewer to create a more isolated test case yet, so thanks for that idea! If needed we can then probably report the issue upstream as a reduced standalone script instead, which makes it easier to reproduce and debug. |
I cannot really help with the Chrome implementation of WebDriver BiDi and what might be the culprit here. @OrKoN could you may have a look at it? It looks like it's something around mouse clicks but it's interesting that the referenced code works some lines above and then the same click doesn't work when run again. |
@whimboo thanks for pinging, I can take a look |
I get the above error. Could you perhaps share the Puppeteer logs for that test run? |
Normally this test has been fixed in #17962 |
Right, so the test passes for me on that branch. Is the OOM the only remaining issue? |
I was able to run all integration tests locally on a Mac and I didn't see any extreme memory usage. I got two test failures but it looked like some wrong selectors? I would recommend setting protocolTimeout to some lower value like 10sec to catch any timeouts earlier if you do not expect to have long running calls. |
Yes the last tries with the PR above gave us this OOM crash on the linux bot only.
in the middle of the unit tests on the Windows 10 bot. |
Could you try it with the canary build (install |
Done: #17962 (comment) |
Same OOM crash with canary. |
Which node version do you use? |
18.16.0 |
Actually, after I tried to run it one more time and left it unattended without moving the mouse, all tests passed. |
I have been looking at the integration test code and noticed the following code: https://github.com/mozilla/pdf.js/blob/master/test/test.mjs#L908-L910
Some time ago I tried using WebDriver BiDi for Chrome too and I recall it failed pretty soon back then. However, I tried again today with the current Puppeteer version and the results are much better now: only one test failure remains! Hence I figured now might be a good time to re-investigate WebDriver BiDi compatibility for Chrome, since it would be great if we could move away from CDP for all browsers we support.
I tried debugging this test,
FreeText Editor Freetext must stay focused after having been moved must keep the focus
, but I can't figure out why this works with CDP and fails with WebDriver BiDi. The traceback of the failing test is:Interestingly I found that the test passes with WebDriver BiDi if I comment out this:
pdf.js/test/integration/freetext_editor_spec.mjs
Lines 2362 to 2366 in 7290faf
I have enabled verbose logging using the Puppeteer debugging instructions from https://github.com/puppeteer/puppeteer/blob/ef8c4c808aa9dddd4d2501c8fc160cfcd0c4b9d1/docs/guides/debugging.md?plain=1#L131 but I can't really interpret the output because I don't know much about the WebDriver BiDi protocol and Puppeteer internals.
To reproduce the issue:
npm install
.cdp
towebDriverBiDi
inpdf.js/test/test.mjs
Line 881 in 7290faf
it
tofit
inpdf.js/test/integration/freetext_editor_spec.mjs
Line 2315 in 7290faf
npx gulp integrationtest
and notice that the test hangs. If the protocol is changed to CDP the test passes. The verbose debugging logging can be obtained withenv DEBUG="puppeteer:*" npx gulp integrationtest
, for which it helps to change https://github.com/mozilla/pdf.js/blob/master/test/test.mjs#L961 to only run Chrome (otherwise Firefox also spams the logs).@whimboo Is this perhaps something you could help out with? It could have surfaced a bug in the WebDriver BiDi implementation, but because I'm stuck on debugging this I also can't create a reduced test case to report to upstream...
The text was updated successfully, but these errors were encountered: