-
-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[java] Use Process class to execute SM in Java (fix #13091) #13123
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## trunk #13123 +/- ##
=======================================
Coverage 57.70% 57.70%
=======================================
Files 86 86
Lines 5289 5289
Branches 208 208
=======================================
Hits 3052 3052
Misses 2029 2029
Partials 208 208 ☔ View full report in Codecov by Sentry. |
I think it might be better to fix the root cause in the ExternalProcess class. One possible cause could be reading the outputstream asynchronous in a different thread. A possible fix to this would be to call I could create a PR for this. |
I agree that if the But in the particular case of the |
The One example, if the SM would send a huge output to stdout the process would lock as soon as the outputbuffer is full. In the PR the java code will wait for the process to exit, before reading the stdout. |
Just for the record, the SM output should not be long. It should be a JSON file with around 55 lines (i.e., less than 2K). In case of an unexpected error, the output (panic description) should be even less. |
I just pushed d1787a9 to ensure processing the output has been completed before returning from a |
59cb63d
to
4c61ebe
Compare
are there any updates here? |
@bonigarcia @joerg1985 did you folks agree on something? Are we using the |
It is safe to use the |
PS: SeleniumHQ/docker-selenium#2008 should make the retry obsolete and it might be a good idea to remove the retry again, to see if the root issue happens outside docker too. |
I don't remember where, but someone mentioned this issue outside Docker. |
I don't have a strong opinion on this. I created this PR for the first time because there was a problem related to the execution of Selenium Manager in Java, in which the Selenium Manager was sometimes empty. My intuition was the problem in which the SM process was executed in Java. For that reason, I changed using the After solving the first issue, a second problem occurs ( Regarding the use of |
@bonigarcia - ExternalProcess I think is just an abstraction of |
I released a new set of Docker images (https://github.com/SeleniumHQ/docker-selenium/releases/tag/4.15.0-20231122), now the browser driver path is set via properties and with that, Selenium Manager is avoided. I would leave this PR open for a while in case people still report this issue in non Docker environments. |
Hi there!
That wasn't me, but we do have this problem outside of Docker. It's the same "error failed to parse json output" error mentioned in #13091:
|
Have you tried again with the Nightly version? https://www.selenium.dev/downloads/#nightly |
I have done so now (using 4.16.0-SNAPSHOT), and the problem seems to be fixed! 🎉 |
Great. Then it seems this PR won't be needed. Let's wait until we get more feedback. |
@bonigarcia 💯 agree with you. I'd especially appreciate it if someone could include this test as well among the others. Well, in the meantime, I've already confirmed that the download test is okay in Docker. I'll now try it in a real Kubernetes cluster. Tested also in AKS, it seems ok. |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as off-topic.
if current issue seems like solved, can we release this fix? |
guys, who can make go/no go release this fix, since our team is experiencing this issue and we need to fix it? |
If you need this now, you can use Nightly: https://www.selenium.dev/downloads/#nightly We will try to do a release next week if time and availability permits. |
@giuliohome those errors are not related to the issue, you see this error in the Node. I will mark those comments as off-topic. |
I have forwarded your response to my colleague. From my perspective, I have communicated my stance on the matter - that this doesn't align with an open-source approach. I strongly advise against using such software in our company. |
what doesn't align with an open source approach? It appears that your recent comments do not apply to the solution provided by this PR. Please open a new issue if there is a problem that needs to be addressed. |
The way you assess that my comments do not apply and mark them as off-topic raises a concern. The point I'm making is precisely that my comments are closely tied to the ongoing discussion. Specifically, regarding the use of Process vs. ExternalProcess, and the feedback requested just before them. More broadly, the issue extends to the lack of clarification in your statement:
This statement is rather brief and could be interpreted as somewhat dismissive. To provide a clearer context, I'd like to emphasize that I observed the error in the router log, seemingly linked to an exception when saving the process output - a matter discussed previously. Even if there's a misunderstanding on my part, the communication doesn't seem conducive to a collaborative approach that values understanding users' perspectives (from a devrel communication perspective, it's crucial to ensure a more open and receptive tone, even when closing a comment). |
I replied that because Selenium Manager is being used only in the Node, and the issue is about that, not the Router, where no external processes are executed, everything is already in the JAR file. If you are seeing something similar that requires a separate issue with enough context, let us know how to troubleshoot it. That is why I marked them as off-topic. |
The situation is much clearer now. It turns out I was initially selecting the wrong pod in Grafana. For instance, the error I observed from the Node pod is as follows:
This error seems somehow related to the ongoing discussion. Additionally, during the same timeframe, the Kubernetes Ingress Controller reported lines referring to both the Router and the download part of our test:
|
can we merge it and release? |
4.16.1 is out, are you still seeing the issue with this version? |
Please be careful about reading into things in responses here. The Selenium team is composed of people from many countries and cultures and languages. You will see a variety of tones and terseness in the conversations in our Slack and in our GitHub issues. We get a lot of new issues every day and most of the work is the thankless job of trying to differentiate between things that need to be fixed and things that don't need to be fixed, and things that help us determine between those conditions and things that do not. If something can get put in a "not helpful" bucket, we're going to quickly put it there so we can sift through the next pile of information. |
That's also my job, though in a different context. Meanwhile I understood what was the cause of the message that has been put off-topic here and indeed it has been thanks to a colleague of mine that pointed me to the problem by asking me to solve an issue seen by a dev team working for us. So again, my conclusion is that before differentiating things must be well understood and often the communication among different teams is key. Back to the main topic, here now I don't understand why someone wants to merge this if the underlying issue seems to be already fixed in a quite different way:
|
The issue is that while Selenium Manager should work on Docker, it shouldn't get used on Docker. So we added the code to keep it from getting used. But the same thing that caused the problem we saw on Docker may exist in non-docker environments, and we may need this PR to address it, so we're leaving it open. |
I believe this PR is no longer needed. I'm closing it. |
Description
This PR changes the use of the
org.openqa.selenium.build.ExternalProcess
Selenium class to the standardjava.lang.Process
(throughjava.lang.ProcessBuilder
) to execute Selenium Manager in Java.UPDATE: The second commit in this PR includes some logic for retrying the command execution, as reported in #13091.
Motivation and Context
It has been reported by some users (see #13091) that sometimes, the
SeleniumManager
Java logic fails due to an empty output by Selenium Manager. After troubleshooting it, it seems the cause is the use ofExternalProcess
, and usingProcess
fixes it.Types of changes
Checklist