开发者

Selenium internal server error cause by captureNetworkTraffic()?

开发者 https://www.devze.com 2023-02-05 03:54 出处:网络
Essentially, I\'m spawning a multitude of selenium client instances which all开发者_开发百科 connect to one selenium server.

Essentially, I'm spawning a multitude of selenium client instances which all开发者_开发百科 connect to one selenium server.

Running about 20 at one time works perfectly fine on my box.

I then added a feature that uses the captureNetworkTraffic() method to read the network traffic as JSON so that I can log the stats to each instance's respective run log.

And now, suddenly, if I run anymore than maybe 3 or 4 at one time, they nearly all fail with a lovely "Internal Selenium Server Error"!

I have done several different tries (with different browsers) both with and without the network stats info being logged, and they all point to the same conclusion: I can't run more than 3 or 4 with this feature.

Does anyone perhaps know why this is? I know for sure this is the cause of the failures too for I've isolated the failure to just this single line of code.

Thank you


I've found the culprit: java.util.ConcurrentModificationException

According to this support post, the internal ArrayList handling the network traffic statistics isn't syncronized, and is sometimes trying to be concurrently modified, i.e. when you're attempting to run 40 different clients at one time!


I'm running a fairly large setup of selenium scripts at my work and I did some time ago changed all the scripts so every single one starts its own Selenium Server dynamically on seperate ports.

First of all I did run in to similar problem as yours where random errors occurs(Under some load Selenium Server does not always handle very well). But the big benfit was to not have to make sure selenium server is running etc, just to fire up the scripts.

Sure, it does use a lot more memory but I rather troubleshooting our own products instead of Selenium Server :)

0

精彩评论

暂无评论...
验证码 换一张
取 消