fix(任务中心): 修复任务数量统计和实际执行数不一致问题

--bug=1010583 --user=赵勇 【任务中心】-执行测试计划包括20个用例-任务中心只显示当前页的正在执行的用例数,实际有20个正在执行 https://www.tapd.cn/55049933/s/1109348
This commit is contained in:
fit2-zhao 2022-02-24 10:29:05 +08:00 committed by fit2-zhao
parent 60221bd4e9
commit 6f2ceff67a
2 changed files with 7 additions and 17 deletions

View File

@ -40,10 +40,12 @@ public class JmeterThreadUtils {
Thread[] lstThreads = new Thread[noThreads];
currentGroup.enumerate(lstThreads);
for (int i = 0; i < noThreads; i++) {
if (StringUtils.isNotEmpty(reportId) && StringUtils.isNotEmpty(lstThreads[i].getName()) && lstThreads[i].getName().startsWith(reportId)) {
return true;
} else if (StringUtils.isNotEmpty(testId) && StringUtils.isNotEmpty(lstThreads[i].getName()) && lstThreads[i].getName().startsWith(testId)) {
return true;
if (lstThreads[i] != null) {
if (StringUtils.isNotEmpty(reportId) && StringUtils.isNotEmpty(lstThreads[i].getName()) && lstThreads[i].getName().startsWith(reportId)) {
return true;
} else if (StringUtils.isNotEmpty(testId) && StringUtils.isNotEmpty(lstThreads[i].getName()) && lstThreads[i].getName().startsWith(testId)) {
return true;
}
}
}
return false;

View File

@ -314,7 +314,7 @@ export default {
if (status === "waiting" || status === 'stop') {
return 0;
}
if (status === 'saved' || status === 'completed' || status === 'success' || status === 'error'|| status === 'errorreportresult') {
if (status === 'saved' || status === 'completed' || status === 'success' || status === 'error' || status === 'errorreportresult') {
return 100;
}
}
@ -398,17 +398,6 @@ export default {
getTaskRunning() {
this.initWebSocket();
},
calculationRunningTotal() {
if (this.taskData) {
let total = 0;
this.taskData.forEach(item => {
if (this.getPercentage(item.executionStatus) !== 100 && this.getPercentage(item.executionStatus) !== 0) {
total++;
}
});
this.runningTotal = total;
}
},
init() {
if (this.showType === "CASE" || this.showType === "SCENARIO") {
return;
@ -417,7 +406,6 @@ export default {
this.result = this.$post('/task/center/list/' + this.currentPage + '/' + this.pageSize, this.condition, response => {
this.total = response.data.itemCount;
this.taskData = response.data.listObject;
this.calculationRunningTotal();
this.initEnd = true;
this.loading = false;
});