fix(接口测试): 修复swagger、postman、har格式导入的接口没有超时时间问题

--bug=1022544 --user=郭雨琦
https://www.tapd.cn/55049933/bugtrace/bugs/view/1155049933001022544
This commit is contained in:
guoyuqi 2023-02-07 15:26:17 +08:00 committed by xiaomeinvG
parent be1c4e1ffb
commit 2bea883de7
4 changed files with 8 additions and 0 deletions

View File

@ -55,6 +55,8 @@ public abstract class PostmanAbstractParserParser<T> extends ApiImportAbstractPa
} else {
request.setFollowRedirects(true);
}
request.setResponseTimeout("60000");
request.setConnectTimeout("60000");
return request;
}

View File

@ -103,6 +103,8 @@ public class HarParser extends HarAbstractParser {
if (harRequest != null) {
MsHTTPSamplerProxy request = super.buildRequest(reqName, url, harRequest.method, null);
request.setFollowRedirects(true);
request.setResponseTimeout("60000");
request.setConnectTimeout("60000");
ApiDefinitionWithBLOBs apiDefinition = super.buildApiDefinition(request.getId(), reqName, url, harRequest.method, importRequest);
parseParameters(harRequest, request);
parseRequestBody(harRequest, request.getBody());

View File

@ -140,6 +140,8 @@ public class Swagger2Parser extends SwaggerAbstractParser {
Operation operation = operationMap.get(method);
MsHTTPSamplerProxy request = buildRequest(operation, pathName, method.name());
request.setFollowRedirects(true);
request.setResponseTimeout("60000");
request.setConnectTimeout("60000");
ApiDefinitionWithBLOBs apiDefinition = buildApiDefinition(request.getId(), operation, pathName, method.name(), importRequest);
apiDefinition.setDescription(operation.getDescription());
parseParameters(operation, request);

View File

@ -151,6 +151,8 @@ public class Swagger3Parser extends SwaggerAbstractParser {
if (operation != null) {
MsHTTPSamplerProxy request = buildRequest(operation, pathName, method);
request.setFollowRedirects(true);
request.setResponseTimeout("60000");
request.setConnectTimeout("60000");
ApiDefinitionWithBLOBs apiDefinition = buildApiDefinition(request.getId(), operation, pathName, method, importRequest);
apiDefinition.setDescription(operation.getDescription());
parseParameters(operation, request);