diff --git a/backend/src/main/java/io/metersphere/api/jmeter/JmeterThreadUtils.java b/backend/src/main/java/io/metersphere/api/jmeter/JmeterThreadUtils.java index 3bbde33b23..cfe1f7f916 100644 --- a/backend/src/main/java/io/metersphere/api/jmeter/JmeterThreadUtils.java +++ b/backend/src/main/java/io/metersphere/api/jmeter/JmeterThreadUtils.java @@ -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; diff --git a/frontend/src/business/components/task/TaskCenter.vue b/frontend/src/business/components/task/TaskCenter.vue index f9a440884d..83ce73a5fa 100644 --- a/frontend/src/business/components/task/TaskCenter.vue +++ b/frontend/src/business/components/task/TaskCenter.vue @@ -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; });