Hi all,
I have a question regarding the management of geckodriver zombie processes.
Selenium is designed to kill Geckodriver process when disposing of the webdriver instance like this: driver.quit()
.
In my testing framework, I have configured to call driver.quit()
after each test.
In some cases however, the test terminates abnormally due to various reasons and then the finalizing steps (like quitting the driver) are not being executed. As a result I end up with multiple geckodriver processes that I can only kill manually.
Is there any good practice how to work around this problem? Perhaps monitoring the processes somehow and killing the ones that do not transfer any data?
Or maybe creating few instances and then reusing them?
I am running my tests on Grid so manipulating the process through command line won't work as it will only affect the grid hub.
There is an option of using taskkill
to terminate all the geckodriver processes on a machine but this is not a good solution since:
taskkill
I will kill the ones that are still in use as well.taskkill
is a generally a good practice I would like to find a more elegant solution. E.g. (1)geckodriver processes are monitored on the node and only terminated locally when they are not in use or (2)somehow reused.--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/796f6672-6b63-4a51-b3d6-12d08e91ee54%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/64a37de0-1b1d-4dc5-a71b-8e78bbbceead%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/64a37de0-1b1d-4dc5-a71b-8e78bbbceead%40googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/5cQPSnkg__g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkzydLW0O6iGE0rXX%2B3vqJ4Q4O_gUEDGkWtt7Q175%2BF0g%40mail.gmail.com.
Thanks again Krishnan but please note that I am talking about the geckodriver.exe process, not the actual browser window itself.The browser closes fine, not problem. My issue are the remaining geckodriver processes that are now not bound to anything and keep adding up with each new browser window open.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLkzydLW0O6iGE0rXX%2B3vqJ4Q4O_gUEDGkWtt7Q175%2BF0g%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CA%2BFkgXS7P2PQtyUDEks-NQ_%2B32r%2B%2BDQOkWJHv_9zLOACfAJiag%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CA%2BFkgXS7P2PQtyUDEks-NQ_%2B32r%2B%2BDQOkWJHv_9zLOACfAJiag%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Selenium Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/selenium-users/5cQPSnkg__g/unsubscribe.
To unsubscribe from this group and all its topics, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZL%3DUNGuNuDEHL6Kz-hnWuDbuu6NbZcUFy3Qn1N9tTD7rGg%40mail.gmail.com.
And this is exactly my problem :)driver.quit() is not being executed and exactly as you describe - does not kill the geckodriver.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZL%3DUNGuNuDEHL6Kz-hnWuDbuu6NbZcUFy3Qn1N9tTD7rGg%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CA%2BFkgXRv9HPBngWHjXVmec5him%3D1UC23dMYCspcoPW-uVZKqdg%40mail.gmail.com.
But remember, even in the case of client crashes (your test case running JVM crashed or was forcibly killed), the JVM that runs the selenium node (this is obviously a different one from the client) will still clean up the browser and the associated server process (when any of the timeout criteria is met).
Thanks & Regards
Krishnan Mahadevan
"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/My Technical Scribbings @ http://rationaleemotions.wordpress.com/
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZL%3DyOmRKWcHwMm6bgxjSYiZeu%3DRovEY_QKSgRz_tOPae1w%40mail.gmail.com.To post to this group, send email to selenium-users@googlegroups.com.
Thanks,So do you say that the selenium standalone server process that is running on the node should cleanup the browser and the associated geckodriver instance even if a specific test has failed without performing a preconfigured cleanup sequence?
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZL%3DyOmRKWcHwMm6bgxjSYiZeu%3DRovEY_QKSgRz_tOPae1w%40mail.gmail.com.
--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CA%2BFkgXTdV70awRoiuueS%2B_X42S_qMqs7Hbj97KnAwc8jSqc5PA%40mail.gmail.com.