question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Zombie Chrome process after creating failed for chromedriver

See original GitHub issue

šŸ› Bug Report

When creating a new Driver using the C# bindings on windows (Specifically in this case Chrome) when initialization fails, a chrome process is created without a chromedriver process. The error is OpenQA.Selenium.WebDriverException: unknown error: failed to wait for extension background page to load

To Reproduce

The error happens when I am running 40-50 chromedrivers in parallel. It doesnt happen if I use small number of chromedrivers like 5 or 10. The more chromedrivers I use, the faster that error happens.

Detailed steps to reproduce the behavior:

Expected behavior

The chrome process is not created when creating chromedriver failed

Environment

OS: Windows 10 Browser: Chrome Browser version: 77.0.3865.75 Browser Driver version: ChromeDriver 77.0.3865.40 Language Bindings version: C# 4.0.30319 Selenium Grid version (if applicable): No

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
RKayCHcommented, Nov 9, 2019

This is nothing new and I think you expectation is wrong - - if my assumptions are false, I preemptively say sorry.

Chrome itself is a different piece of software, it’s not part of Selenium, not even of the Chromedriver. When u start execution of code ā€œout of the scopeā€ (in this moment: Chromedriver triggering the start of the Chrome process) and the calling part fails, there’s no way to jump back into the external code - so the only way would be to forcefully kill the chrome process - which would also not meeting your expectations as the the process is created when chromedriver is triggering it šŸ˜‰

Init fail does (as everywhere) disconnect chromedriver from chrome. Unless the Chrome devs include something like a timeout when chrome is triggered by Chromedriver or include a reconnect during the (short) start (doubt that u can restart a failed chromedriver init so quick, that you are able to reconnect BEFORE chrome is opened).

I had problems with such zombie chromes a along time. My solution in the end:

Whenever I start a chromedriver, I let my application scan for chrome.exe with their property StartTime > the startTime of Chromedriver. I store the PID of that process. No matter if it fails or goes through, I can always sure and quickly identify the zombie and get rid of it with a simple

GetProcessById(pid).Kill()

That way i can keep my automation going on for weeks, never running into serious issues due to zombie processes etc.

Above all: think it’s not even a Selenium problem - if even it’s a Chromedriver thing (which is not developed by Selenium developers. But I think more it’s a general problem based on the fact that we’re talking here about 3 different products that hook into each other / communicate and being developed independently from each other. The term mostly used for this is ā€œflakynessā€. Such init issues etc. - well - such flakyness you’ll also find on test frameworks where the majority is being developed by companies.

And btw: 40-50 on a single systsem is not a good idea, flakyness becomes more extreme. Better move some to another box or simply run more tests in sucession than paralalel.

Keep in mind, Selenium is made for Application Testing, not really for huge aautomation / scraping tasks (even I use it heavily for thata - but i’m using it distributed, never more than 10-15 on same machine - depending on the actualy system, sometimes even just 5-7.

0reactions
lock[bot]commented, Apr 4, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to kill Chrome process and running out of memory with ...
The trouble is, at the end of each job when the quit() method is called chrome goes into zombie mode. When the next...
Read more >
Chrome exits leaving zombies. Zombies interfere with starting ...
What happens instead? Chrome exits leaving zombie processes. These zombie interfere with starting later instances of Chrome, accumulate in memory, and take upĀ ......
Read more >
Issue 551116 in chromium: chrome crash during dark resume ...
dark resume leaves zombie processes, reparented to init, which makes new chrome instance unusable. ... This is expected after killing the processes failed....
Read more >
Defunct processes while running Selenium webdrivers
its likely Selenium leavingbehind the dead processes. However the dead processes shouldnt be taking up any resources other than an extra PIDĀ ...
Read more >
Resolve: Killing Zombie Processes created by Selenium
Eventually, my command ends and the test failed to run. I'm running this in a secure environment on a separate machine and can't...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found