当来自 Jenkins 的 运行 SOAP 请求(testrunner.bat)时遇到 SocketTimeoutExceptions

Experiencing SOcketTimeoutExceptions when running SOAP requests(testrunner.bat) from Jenkins

我们在 运行 上遇到 java.net.SocketTimeoutException error 来自 testrunner.bat 的 SOAP 请求,该请求在 Jenkins 中配置为 Windows 批处理命令。

Windows Jenkins中使用的命令代码: 回声 %WORKSPACE% 设置 currentDir=%WORKSPACE% 设置 projectDir="%currentDir%\Connect-Smoke-Suite.xml" 回声 %projectDir% cd C:\Program Files (x86)\SmartBear\SoapUI-5.4.0\bin REM testrunner.bat -a %projectDir% -s"placeOrders" -e"https://qa.connect.com/ws/orders.wsdl"

请查找错误日志。

13:27:30,742 INFO  [log] [A136792, A125812]
13:27:30,752 INFO  [SoapUITestCaseRunner] running step [placeOrder]
13:27:30,913 DEBUG [HttpClientSupport$SoapUIHttpClient] Attempt 1 to execute request
13:27:30,914 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Sending request: POST /ws/orders.wsdl HTTP/1.1
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook
13:28:30,967 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection closed
13:28:30,968 DEBUG [HttpClientSupport$SoapUIHttpClient] Closing the connection.
13:28:30,968 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection closed
13:28:30,968 DEBUG [SoapUIMultiThreadedHttpConnectionManager$SoapUIDefaultClientConnection] Connection shut down
13:28:30,970 ERROR [WsdlSubmit] Exception in request: java.net.SocketTimeoutException: Read timed out
13:28:30,970 ERROR [SoapUI] An error occurred [Read timed out], see error log for details
java.net.SocketTimeoutException: Read timed out
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.socketRead(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at java.net.SocketInputStream.read(Unknown Source)
    at sun.security.ssl.InputRecord.readFully(Unknown Source)
    at sun.security.ssl.InputRecord.read(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
    at sun.security.ssl.SSLSocketImpl.readDataRecord(Unknown Source)
    at sun.security.ssl.AppInputStream.read(Unknown Source)
    at org.apache.http.impl.io.AbstractSessionInputBuffer.fillBuffer(AbstractSessionInputBuffer.java:149)
    at org.apache.http.impl.io.SocketInputBuffer.fillBuffer(SocketInputBuffer.java:110)
    at org.apache.http.impl.io.AbstractSessionInputBuffer.readLine(AbstractSessionInputBuffer.java:264)
    at org.apache.http.impl.conn.DefaultResponseParser.parseHead(DefaultResponseParser.java:98)
    at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:252)
    at org.apache.http.impl.AbstractHttpClientConnection.receiveResponseHeader(AbstractHttpClientConnection.java:281)
    at org.apache.http.impl.conn.DefaultClientConnection.receiveResponseHeader(DefaultClientConnection.java:247)
    at org.apache.http.impl.conn.AbstractClientConnAdapter.receiveResponseHeader(AbstractClientConnAdapter.java:219)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$SoapUIHttpRequestExecutor.doReceiveResponse(HttpClientSupport.java:147)
    at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:125)
    at org.apache.http.impl.client.DefaultRequestDirector.tryExecute(DefaultRequestDirector.java:633)
    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:454)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
    at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:754)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport$Helper.execute(HttpClientSupport.java:233)
    at com.eviware.soapui.impl.wsdl.support.http.HttpClientSupport.execute(HttpClientSupport.java:323)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.submitRequest(HttpClientRequestTransport.java:297)
    at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:227)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:119)
    at com.eviware.soapui.impl.wsdl.WsdlSubmit.submitRequest(WsdlSubmit.java:79)
    at com.eviware.soapui.impl.wsdl.WsdlRequest.submit(WsdlRequest.java:217)
    at com.eviware.soapui.impl.wsdl.teststeps.WsdlTestRequestStep.run(WsdlTestRequestStep.java:364)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:211)
    at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:47)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:138)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:46)
    at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:128)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
13:28:30,975 INFO  [SoapUITestCaseRunner] Assertion [SOAP Response] has status UNKNOWN

您可以使用以下说明增加时间:

使用菜单选项File -> Preferences -> HTTP Settings -> Socket Timeout并设置适当的值。然后保存首选项。

编辑:

保存首选项后,设置将保存到位于用户主目录下的文件中。

testrunner.bat 文件允许使用“-t”传递设置文件。使用该选项。