Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Aborted tests leaving behind running selenium processes
Phonesis
#1 Posted : Wednesday, April 20, 2016 2:13:44 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 4/14/2016(UTC)
Posts: 32
Location: United Kingdom

Was thanked: 3 time(s) in 3 post(s)
We are using NCrunch to run hundreds of Selenium based web UI tests. We use Chromedriver to run these.

Many of the tests are timing out and as a result NCrunch is aborting them forcefully. This is fine as we want timeouts to be enforced.

However, the problem is that it looks like the instances of Chromedriver.exe are not being terminated / disposed and are clogging up the grid machines.

Any idea how we can address this? We can't just kill any chrome process in a setup stage because that will interfere with other parallel tests. Is there an NCrunch teardown that can be used at the end of the entire run perhaps to terminate processes etc?
Remco
#2 Posted : Wednesday, April 20, 2016 10:53:13 PM(UTC)
Rank: NCrunch Developer

Groups: Administrators
Joined: 4/16/2011(UTC)
Posts: 7,161

Thanks: 964 times
Was thanked: 1296 time(s) in 1202 post(s)
Hi,

Unfortunately, there isn't any feature in NCrunch that can be targeted to a problem like this. It needs to be solved by the tests themselves.

Ideally, you'd probably want each test to automatically terminate any orphaned chromedriver.exe processes at the start of each run. Pulling up the list of processes and terminating them isn't particularly difficult, but determining which processes are being used and which ones are not is quite a bit harder.

The easiest way I can think of for doing this would be to have some kind of file-based registry that can map the process ID of each NCrunch test host to the process ID of each chromedriver.exe instance being used by this test host. When a test spawns up a chromedriver.exe instance, it identifies the process ID of the new process, then writes this to disk along with its own process ID. Every time a test starts its run, it will read the registry, then compare the process IDs of chromedriver.exe and test hosts against the list of running processes on the machine. Any chromedriver.exe instances that do not have a running testhost can then be safely terminated. It feels ugly, but this would be very effective. It would ensure chromedriver.exe instances are always cleaned up, even on client machines and when using other test runners.
1 user thanked Remco for this useful post.
samholder on 5/10/2016(UTC)
samholder
#3 Posted : Tuesday, May 10, 2016 5:19:38 PM(UTC)
Rank: Advanced Member

Groups: Registered
Joined: 5/11/2012(UTC)
Posts: 94

Thanks: 28 times
Was thanked: 12 time(s) in 12 post(s)
This is a good idea for a solution, thanks!
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

YAF | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.033 seconds.
Trial NCrunch
Take NCrunch for a spin
Do your fingers a favour and supercharge your testing workflow
Free Download