fix(接口测试): 修复不同节点执行时区不一致情况下报告时间错误问题
--bug=1010397 --user=赵勇 case列表 并行执行 集合报告 选择资源池 执行时间过长 https://www.tapd.cn/55049933/s/1106305
This commit is contained in:
parent
25cadc9115
commit
5a9248f782
|
@ -66,7 +66,6 @@ public class ApiDefinitionExecResultService {
|
||||||
LoggerUtil.info("接收到API/CASE执行结果【 " + requestResults.size() + " 】");
|
LoggerUtil.info("接收到API/CASE执行结果【 " + requestResults.size() + " 】");
|
||||||
|
|
||||||
for (RequestResult item : requestResults) {
|
for (RequestResult item : requestResults) {
|
||||||
item.setEndTime(System.currentTimeMillis());
|
|
||||||
if (item.getResponseResult() != null && item.getResponseResult().getResponseTime() <= 0) {
|
if (item.getResponseResult() != null && item.getResponseResult().getResponseTime() <= 0) {
|
||||||
item.getResponseResult().setResponseTime((item.getEndTime() - item.getStartTime()));
|
item.getResponseResult().setResponseTime((item.getEndTime() - item.getStartTime()));
|
||||||
}
|
}
|
||||||
|
|
|
@ -195,6 +195,9 @@ public class ApiScenarioReportStructureService {
|
||||||
} else if (step.getValue() != null) {
|
} else if (step.getValue() != null) {
|
||||||
if (step.getValue().getStartTime() == 0 || step.getValue().getEndTime() == 0) {
|
if (step.getValue().getStartTime() == 0 || step.getValue().getEndTime() == 0) {
|
||||||
totalTime.set(totalTime.longValue() + 0);
|
totalTime.set(totalTime.longValue() + 0);
|
||||||
|
} else if (step.getValue().getStartTime() > step.getValue().getEndTime() && step.getValue().getResponseResult() != null) {
|
||||||
|
// 异常时间处理
|
||||||
|
totalTime.set(totalTime.longValue() + step.getValue().getResponseResult().getResponseTime());
|
||||||
} else {
|
} else {
|
||||||
totalTime.set((totalTime.longValue() + (step.getValue().getEndTime() - step.getValue().getStartTime())));
|
totalTime.set((totalTime.longValue() + (step.getValue().getEndTime() - step.getValue().getStartTime())));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue