fix(测试计划报告): 修复测试计划报告中性能测试用例执行成功时显示未执行的问题

修复测试计划报告中性能测试用例执行成功时显示未执行的问题
This commit is contained in:
song-tianyang 2021-12-10 15:14:20 +08:00 committed by song-tianyang
parent b52ef3e25d
commit dad53a89eb
3 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,8 @@
package io.metersphere.api.cache; package io.metersphere.api.cache;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;
@ -8,6 +11,7 @@ import java.util.Map;
* @Date 2021/8/20 3:29 下午 * @Date 2021/8/20 3:29 下午
*/ */
public class TestPlanReportExecuteCatch { public class TestPlanReportExecuteCatch {
private static Logger testPlanLog = LoggerFactory.getLogger("testPlanExecuteLog");
private static Map<String, TestPlanExecuteInfo> testPlanReportMap = new HashMap<>(); private static Map<String, TestPlanExecuteInfo> testPlanReportMap = new HashMap<>();
private TestPlanReportExecuteCatch() { private TestPlanReportExecuteCatch() {
@ -88,6 +92,7 @@ public class TestPlanReportExecuteCatch {
} }
public static void finishAllTask(String planReportId) { public static void finishAllTask(String planReportId) {
testPlanLog.info("ReportId["+planReportId+"] finish task!");
if(testPlanReportMap.containsKey(planReportId)){ if(testPlanReportMap.containsKey(planReportId)){
testPlanReportMap.get(planReportId).finishAllTask(); testPlanReportMap.get(planReportId).finishAllTask();
} }

View File

@ -1239,6 +1239,7 @@ public class TestPlanReportService {
//20分钟没有案例执行结果更新则定位超时 //20分钟没有案例执行结果更新则定位超时
long lastCountTime = executeInfo.getLastFinishedNumCountTime(); long lastCountTime = executeInfo.getLastFinishedNumCountTime();
long nowTime = System.currentTimeMillis(); long nowTime = System.currentTimeMillis();
testPlanLog.info("ReportId: ["+planReportId+"]; timeCount:"+ (nowTime - lastCountTime));
if (nowTime - lastCountTime > 1200000) { if (nowTime - lastCountTime > 1200000) {
return true; return true;
} }

View File

@ -21,7 +21,10 @@ export default {
return { return {
caseDataMap: new Map([ caseDataMap: new Map([
["success", {name: this.$t('test_track.plan_view.pass'), itemStyle: {color: '#67C23A'}}], ["success", {name: this.$t('test_track.plan_view.pass'), itemStyle: {color: '#67C23A'}}],
["Success", {name: this.$t('test_track.plan_view.pass'), itemStyle: {color: '#67C23A'}}],
["SUCCESS", {name: this.$t('test_track.plan_view.pass'), itemStyle: {color: '#67C23A'}}],
["error", {name: this.$t('test_track.plan_view.failure'), itemStyle: {color: '#F56C6C'}}], ["error", {name: this.$t('test_track.plan_view.failure'), itemStyle: {color: '#F56C6C'}}],
["Error", {name: this.$t('test_track.plan_view.failure'), itemStyle: {color: '#F56C6C'}}],
["run", {name: this.$t('运行中'), itemStyle: {color: '#DEDE10'}}], ["run", {name: this.$t('运行中'), itemStyle: {color: '#DEDE10'}}],
["Prepare", {name: this.$t('api_test.home_page.detail_card.unexecute'), itemStyle: {color: '#909399'}}], ["Prepare", {name: this.$t('api_test.home_page.detail_card.unexecute'), itemStyle: {color: '#909399'}}],
]), ]),