-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Calling Delete Session after Close Window returns error #966
Comments
What happens if you properly call driver.quit() after dirver.close()? The trace log looks like everything went without issues. |
Same log as before, however, this is appended:
Same thing, another zombie process, another crash. |
This is expected behaviour. The Close Window command should end the session if it closes the last window. The subsequent Delete Session command then returns an error because the session has already been ended. Please file a bug with your client. |
So the zombie geckodriver.exe Thread is also "expected behavior" since it doesn't really ever end, right? Also, if I run a hundred different selenium tests, and all of them leave a zombie process draining 20 MB, I will effectively waste 2 GB in RAM. |
It's not a programming flaw whatsoever, as it works for many other people
(including me). The issue was closed as a replica of #966, which how I see
it is exactly what you experience as well. If you have anything that
differs your issue from #966, feel free to say so and I'm sure the members
will consider reopening it. However speaking ill of people who work on this
in their free-time when we don't even know what your code looks like is the
wrong approach if you ask me. A couple things to consider.
…On Mo., 25. Sep. 2017, 10:05 Waldemar M. ***@***.***> wrote:
So the zombie geckodriver.exe Thread is also "expected behavior" since it
doesn't really ever end, right?
I would expect geckodriver to properly close Firefox instead of just
crashing it, since the IEDriver and chromedriver both manage to close their
browsers without crashing them.
Also, if I run a hundred different selenium tests, and all of them leave a
zombie process draining 20 MB, I will effectively waste 2 GB in RAM.
You can close threads all you like, if I need to write workarounds for an
obvious programming flaw then this is actually quite sad for a company of
the size of mozilla.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#966 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWiZGH_W4Osp92wb9llhDx19nyCN7BQwks5sl17WgaJpZM4Pe-4A>
.
|
You're referencing my own ticket @curtisy1. I'm refering to THIS issue, if the geckodriver leaves zombie threads then this is not good. It's not something that can be simply overlooked, since it might be detrimental to the testing environment, since it's wasting RAM and ports. I consider to have a right to criticize other programmers if they're producing potentially dangerous errors. Especially if they're doing this for a big name as mozilla, free-time or not. There's no excuse for leaving flaws in software, if they're avoidable. And this really seems like a geckodriver issue instead of other issues, since I can literally use "driver.quit();" and it doesn't produce the error explained here, however doesn't have the behavior I want to have. I'm going to look into different versions of Firefox, I'll see if that makes any difference and if it does I'll provide my answer here. |
Driver.quit() is the only way to close the driver though, this is expected
behaviour. As far as I know, driver.close() only closes the instance of an
open browser, not the driver. So I'm repeating myself: this is not bad
programming because it only doesn't work for you.
Tell us why you don't want to use driver.quit() and I'm sure we'll find a
solution.
…On Di., 26. Sep. 2017, 09:39 Waldemar M. ***@***.***> wrote:
You're referencing my own ticket @curtisy1 <https://github.com/curtisy1>.
I'm refering to THIS issue, if the geckodriver opens zombie threads then
this is not good. It's not something that can be simply overlooked, since
it might be detrimental to the testing environment, since it's wasting RAM
and ports.
I consider to have a right to criticize other programmers if they're
producing potentially dangerous errors. Especially if they're doing this
for a big name as mozilla, free-time or not. There's no excuse for leaving
flaws in software, if they're avoidable. And this really seems like a
geckodriver issue instead of other issues, since I can literally use
"driver.quit();" and it doesn't produce the error explained here, however
doesn't have the behavior I want to have.
I'm going to look into different versions of Firefox, I'll see if that
makes any difference and if it does I'll provide my answer here.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#966 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AWiZGNXo-OIZUlx2oA22ACm-vju8bd0Wks5smKo7gaJpZM4Pe-4A>
.
|
@KrypTheBear can you please test with Firefox 56.0 which will be released today? I'm fairly sure you won't see the crash anymore. If you want to test right away you can use the latest beta release. I would like to know if that makes a difference to you. But generally it's correct that geckodriver should better handle that. |
Btw. for handling the crash we have issue #954 and bug 1401109 |
@whimboo Alright, using the newest version of the Firefox at least prevents it from crashing, hooray :) As to why I'm unwilling to use driver.quit() => After using driver.close(); to close the active window, and then calling driver.quit(); I recieve an org.openqa.selenium.SessionNotCreatedException which messes up the execution by a good bit. (Like I mentioned in my log before that you were asking for. @curtisy1 ) This should not be expected behavior. I suspect that we don't check here for the case of "We just want to close the driver and have no open Firefox sessions". And thanks again for the help, I really do appreciate it. |
For details in how That said, if only a single tab/window is open it will be closed, and as such the session will be closed too. A following call to But reading the spec about Delete Session I see:
There is nothing specified how an already deleted session should be handled. By the above words I assume we should do nothing, and still return success. @andreastt can you please have a closer look here? I'm reopening it for now. |
@whimboo I made a change to the Delete Session command some time ago so that it always return success. I don’t think this is reflected in geckodriver yet. |
Filed https://bugzilla.mozilla.org/show_bug.cgi?id=1403510 to track this. |
Ok, so it's a geckodriver and not Selenium issue. Thanks. |
Dupe of issue #732. |
This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue. |
System
Testcase
The following code attempts to simply open the browser, request "https://www.google.com/" and close the browser again.
Stacktrace
There is no direct stacktrace, since there's no "Exception" happening within the JVM per se, however I get a windows notification, that "Mozilla Firefox stopped working correctly". If you need any logs from that, I'd gladly provide them if you tell me where I can find them.
In addition to that, after Mozilla crashes, it leaves a "geckodriver.exe" zombie process, which can be only killed through
taskkill /im geckodriver.exe /f
constantly draining 20 MB RAM, as well as small amounts of CPU usage, even though the JVM finished execution.
Trace-level log
I have decided to set the Log-Level to "ALL", since the Java geckodriver doesn't support Log.TRACE.
If you need additional information I will provide them as soon as possible.
Best regards,
WM
The text was updated successfully, but these errors were encountered: