microsoft / playwright-java

Java version of the Playwright testing and automation library
https://playwright.dev/java/
Apache License 2.0
1.14k stars 205 forks source link

[Question] what is the reason when the "Browser.close" message was sent, but never received a response message back? #347

Closed ephung01 closed 3 years ago

ephung01 commented 3 years ago

image

image

T runUntil(Runnable code, Waitable waitable) { try { code.run(); while (!waitable.isDone()) { connection.processOneMessage(); } return waitable.get(); } finally { waitable.dispose(); } } ->> waitable.isDone() always return not done (null message in polling). Is there specific reason? It goes on forever (infinite loop). Can we have time out?
ephung01 commented 3 years ago

1.11.0-SNAPSHOT

It's still stuck for 30 seconds and get force kill. I see alot more log print out; and certificate display with non-displayable characters, but when I post it is just blank space characters (see pix)

Here is the Log file

cert with non display character image

yury-s commented 3 years ago

Hmm, this is something new. Do you think you see more logs because of the aforementioned change or just because the browser has been updated since last time?

yury-s commented 3 years ago

Here is the Log file

This URL gives me error 404.

ephung01 commented 3 years ago

Here is the Log file

This URL gives me error 404.

Sorry access issue. Fixed.

ephung01 commented 3 years ago

Hmm, this is something new. Do you think you see more logs because of the aforementioned change or just because the browser has been updated since last time?

There is no browser upgrade version on the box. More likely it's the changes in Playwright.

yury-s commented 3 years ago

Sorry access issue. Fixed.

The USB error persists across all logs, so it seems that this is a problem with the usb discovery service in Chrome working hard and getting into the way of the normal shutdown flow. We've seen similar issue in a network that had a lot of chrome cast devices, Chrome was busy discovering all of them.

Since the version you are running is less than 89 (the flag was replaced with --enable-device-discovery-notifications after starting 89), can you try launching with --disable-device-discovery-notifications flag and see if it makes any difference?

browserType.launch(new BrowserType.LaunchOptions().setArgs(Arrays.asList("--disable-device-discovery-notifications")));
ephung01 commented 3 years ago
browserType.launch(new BrowserType.LaunchOptions().setArgs(Arrays.asList("--disable-device-discovery-notifications")));

I add option "--disable-device-discovery-notifications" still has the same result. 30 seconds and force kill. All UBS ports are blocked as the company policy - cannot copy information to external storage. This could be the problem if chrome tries to access the UBS devices.

yury-s commented 3 years ago

Yeah, my hunch is that something gets busted when the usb ports are blocked. It'd be nice to just disable those discovery services altogether in chrome but I don't see an easy way to do so, we may need to add a flag to chrome for that.

mxschmitt commented 3 years ago

Closing as part of the triage process. Please create a new issue with a detailed reproducible if you still face issues with Playwright for Java.