我有一个使用以下参数运行的selenium服务器实例:
java -DPOOL_MAX=512 -Xmx2G -XX:+UseConcMarkSweepGC -XX:ParallelCMSThreads=2 -Djava.security.egd=file:/dev/./urandom -Dcom.sun.management.jmxremote.port=8090 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -cp /jhub/_prod/server_ptiqaaeryn_selenium_daemon/lib/*:/jhub/_prod/server_ptiqaaeryn_selenium_daemon/lib/.:/jhub/_prod/server_ptiqaaeryn_selenium_daemon/conf/. org.openqa.grid.selenium.GridLauncher -port 4444 -role hub -hubConfig /jhub/_prod/server_ptiqaaeryn_selenium_daemon/conf/hub.json
hub json包含以下
{
"host": 10.1.22.116,
"port": 4444,
"newSessionWaitTimeout": -1,
"servlets" : [],
"prioritizer": null,
"capabilityMatcher": "com.buongiorno.qa.crais.idCapabilityMatcher",
"throwOnCapabilityNotPresent": true,
"nodePolling": 5000,
"cleanUpCycle": 5000,
"timeout": 300000,
"browserTimeout": 5000,
"maxSession": 50,
"jettyMaxThreads": -1,
"nodePolling": 5000,
"downPollingLimit": 2,
"unregisterIfStillDownAfter": 5000
}
每次节点无法应答集线器请求时,我都会收到以下错误
INFO 2015-06-29 12:31:18,679 [Probing status of http://10.57.11.11:4739/wd/hub/status][] execchain.RetryExec:execute(94) - I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {}->http://10.57.11.11:4739: The target server failed to respond
DEBUG 2015-06-29 12:31:18,688 [Probing status of http://10.57.11.11:4739/wd/hub/status][] execchain.RetryExec:execute(101) - The target server failed to respond
org.apache.http.NoHttpResponseException: The target server failed to respond
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260)
at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:161)
at org.apache.http.impl.conn.CPoolProxy.receiveResponseHeader(CPoolProxy.java:153)
at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271)
at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:254)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.openqa.grid.internal.BaseRemoteProxy.getStatus(BaseRemoteProxy.java:516)
at org.openqa.grid.web.servlet.beta.WebProxyHtmlRendererBeta.getHtmlNodeVersion(WebProxyHtmlRendererBeta.java:78)
at org.openqa.grid.web.servlet.beta.WebProxyHtmlRendererBeta.renderSummary(WebProxyHtmlRendererBeta.java:54)
at org.openqa.grid.web.servlet.beta.ConsoleServlet.process(ConsoleServlet.java:128)
at org.openqa.grid.web.servlet.beta.ConsoleServlet.doGet(ConsoleServlet.java:63)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.seleniumhq.jetty7.server.Server.handle(Server.java:345)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:884)
at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:938)
at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:634)
at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:230)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Thread.java:745)
DEBUG 2015-06-29 12:31:18,677 [Probing status of http://10.57.11.11:4739/wd/hub/status][] execchain.ConnectionHolder:abortConnection(126) - Connection discarded
和集线器冻结。 仅在关闭节点时,集线器才会重新启动,否则在
http://10.1.22.116:4444/grid/console
页面没有响应。
我想我的某些hub.json参数配置错误,否则没有响应的节点不应该挂起整个集线器。 我的第一个目标是不明白为什么节点没有响应,但要理解避免故障节点浪费在整个集线器上。
答案 0 :(得分:0)
我认为你必须在JSON中增加Browser_Timeout参数。 5000是5秒。因此,如果节点没有回复5秒,它将抛出此错误,然后将该特定节点标记为已消失。