请教大神,ngrinder相关ERROR Read timed out的错误,超时时间可以在哪边设置呢?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

请教大神,ngrinder相关ERROR Read timed out的错误,超时时间可以在哪边设置呢?

soul
增大并发后,报了如下错误:
2017-07-12 17:04:28,962 ERROR Read timed out
net.grinder.plugin.http.TimeoutException: Read timed out
        at HTTPClient.BufferedInputStream.fillBuff(BufferedInputStream.java:172) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.BufferedInputStream.read(BufferedInputStream.java:110) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.StreamDemultiplexor.read(StreamDemultiplexor.java:277) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.RespInputStream.read(RespInputStream.java:155) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.RespInputStream.read(RespInputStream.java:115) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.Response.readResponseHeaders(Response.java:980) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.Response.getHeaders(Response.java:698) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.Response.getVersion(Response.java:290) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.sendRequest(HTTPConnection.java:3239) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.handleRequest(HTTPConnection.java:2883) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.setupRequest(HTTPConnection.java:2675) ~[grinder-httpclient-3.9.1.jar:na]
        at HTTPClient.HTTPConnection.Get(HTTPConnection.java:986) ~[grinder-httpclient-3.9.1.jar:na]
        at net.grinder.plugin.http.HTTPRequest$2.doRequest(HTTPRequest.java:504) ~[grinder-http-3.9.1.jar:na]
        at net.grinder.plugin.http.HTTPRequest$AbstractRequest.getHTTPResponse(HTTPRequest.java:1276) ~[grinder-http-3.9.1.jar:na]
        at net.grinder.plugin.http.HTTPRequest.GET(HTTPRequest.java:499) ~[grinder-http-3.9.1.jar:na]
        at net.grinder.plugin.http.HTTPRequest.GET(HTTPRequest.java:474) ~[grinder-http-3.9.1.jar:na]
        at P2P_getconfOne.test(P2P_getconfOne.groovy:92) ~[na:na]
        at net.grinder.scriptengine.groovy.junit.GrinderRunner.run(GrinderRunner.java:170) ~[ngrinder-groovy-3.4.1.jar:na]
        at net.grinder.scriptengine.groovy.GroovyScriptEngine$GroovyWorkerRunnable.run(GroovyScriptEngine.java:147) ~[ngrinder-groovy-3.4.1.jar:na]
        at net.grinder.engine.process.GrinderThread.run(GrinderThread.java:118) ~[grinder-core-3.9.1.jar:na]


请问Read timed out的超时时间可以在哪边进行设置呢? 求大神指点哈~ 谢谢
Reply | Threaded
Open this post in threaded view
|

Re: 请教大神,ngrinder相关ERROR Read timed out的错误,超时时间可以在哪边设置呢?

soul
继续追加一个问题哈~~  请问在脚本中,可以通过什么方法,加载到测试配置里的“测试次数”呢?试了用System.getProperty("grinder.duration")返回为null

Reply | Threaded
Open this post in threaded view
|

Re: 请教大神,ngrinder相关ERROR Read timed out的错误,超时时间可以在哪边设置呢?

WaitUntil
In reply to this post by soul
HTTPPluginControl.getConnectionDefaults().timeout = 8000

脚本里修改,8秒超时
Reply | Threaded
Open this post in threaded view
|

Re: 请教大神,ngrinder相关ERROR Read timed out的错误,超时时间可以在哪边设置呢?

soul
Hi~WaitUntil:
感谢回答,以上报错内容,是在脚本已经修改为120秒的背景下依旧报错:
HTTPPluginControl.getConnectionDefaults().timeout = 120000
请问有其他方法可以进行Read time的相关设置吗?