fix(性能测试): 修复删除测试之后再删除报告报错的问题
This commit is contained in:
parent
748c71d1ba
commit
7a1e44353a
|
@ -96,24 +96,26 @@ public class PerformanceReportService {
|
|||
|
||||
LogUtil.info("Delete report started, report ID: %s" + reportId);
|
||||
|
||||
try {
|
||||
final Engine engine = EngineFactory.createEngine(loadTest);
|
||||
if (engine == null) {
|
||||
MSException.throwException(String.format("Delete report fail. create engine fail,report ID:%s", reportId));
|
||||
}
|
||||
if (loadTest != null) {
|
||||
try {
|
||||
final Engine engine = EngineFactory.createEngine(loadTest);
|
||||
if (engine == null) {
|
||||
MSException.throwException(String.format("Delete report fail. create engine fail,report ID:%s", reportId));
|
||||
}
|
||||
|
||||
String reportStatus = loadTestReport.getStatus();
|
||||
boolean isRunning = StringUtils.equals(reportStatus, PerformanceTestStatus.Running.name());
|
||||
boolean isStarting = StringUtils.equals(reportStatus, PerformanceTestStatus.Starting.name());
|
||||
boolean isError = StringUtils.equals(reportStatus, PerformanceTestStatus.Error.name());
|
||||
if (isRunning || isStarting || isError) {
|
||||
LogUtil.info("Start stop engine, report status: %s" + reportStatus);
|
||||
stopEngine(loadTest, engine);
|
||||
String reportStatus = loadTestReport.getStatus();
|
||||
boolean isRunning = StringUtils.equals(reportStatus, PerformanceTestStatus.Running.name());
|
||||
boolean isStarting = StringUtils.equals(reportStatus, PerformanceTestStatus.Starting.name());
|
||||
boolean isError = StringUtils.equals(reportStatus, PerformanceTestStatus.Error.name());
|
||||
if (isRunning || isStarting || isError) {
|
||||
LogUtil.info("Start stop engine, report status: %s" + reportStatus);
|
||||
stopEngine(loadTest, engine);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
loadTest.setStatus(PerformanceTestStatus.Saved.name());
|
||||
loadTestMapper.updateByPrimaryKeySelective(loadTest);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
LogUtil.error(e.getMessage(), e);
|
||||
loadTest.setStatus(PerformanceTestStatus.Saved.name());
|
||||
loadTestMapper.updateByPrimaryKeySelective(loadTest);
|
||||
}
|
||||
|
||||
// delete load_test_report_result
|
||||
|
|
Loading…
Reference in New Issue