SocketTimeoutException: 从TeamCity使用RestAssured时连接超时。

问题描述 投票:0回答:1

我已经尝试了以下。

  1. 通过代码增加连接时间

    RestAssuredConfig newConfig = RestAssured.config() .httpClient(HttpClientConfig.httpClientConfig().setParam(CoreConnectionPNames.CONNECTION_TIMEOUT, 12000).setParam(CoreConnectionPNames.SO_TIMEOUT, 12000))。

  2. 在请求头中添加了User-Agent

  3. 从本地系统和远程代理手动检查相同的api调用,结果都一样。

但是我得到了java.net.SocketTimeoutException: connect timed out while it is working from local system and not from Teamcity agent execution。

请帮忙

selenium teamcity rest-assured
1个回答
0
投票

问题是TeamCity有一个自己的超时,它没有通过你的代码来改变。你可以通过设置一个内部属性来改变这个属性。管理 > 诊断 > 内部属性。.

这里是要添加的属性。teamcity.agentServer.connectionTimeout=12000

这里是... 文件 为TeamCity创业属性。

我也看了这个Youtrack 门票 与类似的问题。

© www.soinside.com 2019 - 2024. All rights reserved.