Skip to content
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

Selenium fails to launch when running on a single cpu #6605

Closed
AndrewFinlay opened this issue Nov 1, 2018 · 11 comments
Closed

Selenium fails to launch when running on a single cpu #6605

AndrewFinlay opened this issue Nov 1, 2018 · 11 comments

Comments

@AndrewFinlay
Copy link

Hi all,

After the recent update to v3.141.0 I've found that Selenium throws an exception when run on a single cpu.

During our CI process, I'm trying to run Protractor's webdriver-manager tool which depends on Selenium. To use it you typically run webdriver-manager update to get the latest drivers, e.g. Selenium, Chromedriver, etc. Then you run webdriver-manager start, which launches Selenium and Chromedriver etc.

The problem looks to happen during Jetty setup, in 'selenium/java/server/src/org/openqa/selenium/grid/server/BaseServerOptions.java' ln.61 where the max threads is set to 3 for single cpu systems

Meta -

OS: Fedora Linux
Selenium Version: 3.141.0
Browser: N/A
Browser Version: N/A

Expected Behavior -

Selenium starts normally when run on a single cpu

Actual Behavior -

Selenium throws an exception when run on a single cpu

Steps to reproduce -

Launch selenium on a system with a single cpu (we're using a vm), it should throw the following exception:

Exception in thread "main" java.lang.IllegalStateException: Insufficient configured threads: required=3 < max=3 for QueuedThreadPool[qtp707610042]@2a2d45ba{STARTED,3<=3<=3,i=3,q=0}[ReservedThreadExecutor@2f7c2f4f{s=0/1,p=0}]

The exception goes away when increasing the number of cpu's

Full output from webdriver-manager start:

$ webdriver-manager start
[09:11:55] I/start - java -Djava.security.egd=file:///dev/./urandom -Dwebdriver.chrome.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/chromedriver_2.43 -Dwebdriver.gecko.driver=/usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.23.0 -jar /usr/lib/node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-3.141.0.jar -port 4444
[09:11:55] I/start - seleniumProcess.pid: 16354
09:11:56.047 INFO [GridLauncherV3.parse] - Selenium server version: 3.141.0, revision: 2ecb7d9a
09:11:56.240 INFO [GridLauncherV3.lambda$buildLaunchers$3] - Launching a standalone Selenium Server on port 4444
2018-11-01 09:11:56.350:INFO::main: Logging initialized @853ms to org.seleniumhq.jetty9.util.log.StdErrLog
09:11:56.819 INFO [WebDriverServlet.<init>] - Initialising WebDriverServlet
Exception in thread "main" java.lang.IllegalStateException: Insufficient configured threads: required=3 < max=3 for QueuedThreadPool[qtp707610042]@2a2d45ba{STARTED,3<=3<=3,i=3,q=0}[ReservedThreadExecutor@2f7c2f4f{s=0/1,p=0}]
at org.seleniumhq.jetty9.util.thread.ThreadPoolBudget.check(ThreadPoolBudget.java:155)
at org.seleniumhq.jetty9.util.thread.ThreadPoolBudget.leaseTo(ThreadPoolBudget.java:129)
at org.seleniumhq.jetty9.util.thread.ThreadPoolBudget.leaseFrom(ThreadPoolBudget.java:181)
at org.seleniumhq.jetty9.io.SelectorManager.doStart(SelectorManager.java:255)
at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.seleniumhq.jetty9.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.seleniumhq.jetty9.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at org.seleniumhq.jetty9.server.AbstractConnector.doStart(AbstractConnector.java:282)
at org.seleniumhq.jetty9.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:81)
at org.seleniumhq.jetty9.server.ServerConnector.doStart(ServerConnector.java:235)
at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.seleniumhq.jetty9.server.Server.doStart(Server.java:395)
at org.seleniumhq.jetty9.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at org.openqa.selenium.grid.server.BaseServer.start(BaseServer.java:193)
at org.openqa.selenium.remote.server.SeleniumServer.boot(SeleniumServer.java:137)
at org.openqa.grid.selenium.GridLauncherV3.lambda$buildLaunchers$3(GridLauncherV3.java:249)
at org.openqa.grid.selenium.GridLauncherV3.lambda$launch$0(GridLauncherV3.java:86)
at java.util.Optional.map(Optional.java:215)
at org.openqa.grid.selenium.GridLauncherV3.launch(GridLauncherV3.java:86)
at org.openqa.grid.selenium.GridLauncherV3.main(GridLauncherV3.java:70)
[09:28:54] I/start - Staying alive until the Selenium Standalone process exits
[09:28:54] I/start - Selenium Standalone has exited with code 130
@adrianer
Copy link

adrianer commented Nov 2, 2018

I can confirm the issue in my Windows VM also running on a single core...

@tball-dev
Copy link

I can confirm this issue is occurring on CentOS with a single core.

@milindm24
Copy link

Same issue is occurring when I try to run it in the docker container that has single CPU

@diemol diemol added the C-grid label Nov 5, 2018
@diemol
Copy link
Member

diemol commented Nov 5, 2018

@AndrewFinlay @adrianer @Twb3 @milindm24
does this only happen when using the webdriver-manager command? Or also when starting it through java -jar ...?

@milindm24
Copy link

@AndrewFinlay @adrianer @Twb3 @milindm24
does this only happen when using the webdriver-manager command? Or also when starting it through java -jar ...?

it happens for both

@diemol
Copy link
Member

diemol commented Nov 5, 2018

@milindm24 could you please post the command used to start the docker container?

@stephenarifin
Copy link

This is happening for me as well, in Gitlab's CI. Unfortunately, I don't have many details since they abstract out a lot. I opened a support ticket here: https://forum.gitlab.com/t/insufficient-configured-threads-selenium-standalone-chrome/20594

@salamatin
Copy link

@milindm24 could you please post the command used to start the docker container?

@diemol I have the same error using the command from the docker-selenium README:

sudo docker run -d --net grid -e HUB_HOST=selenium-hub -v /dev/shm:/dev/shm selenium/node-firefox:3.141.0-actinium

@shs96c
Copy link
Member

shs96c commented Nov 6, 2018

This should be fixed by d54ebd7. We're preparing a new release with this fix in.

@shs96c
Copy link
Member

shs96c commented Nov 6, 2018

3.141.5 has now been released, with this fix in. Share and enjoy!

@rkabadigit
Copy link

Thanks for the fix, @shs96c! Tests are running again :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

9 participants