解决测试计划性能测试相关bug

This commit is contained in:
liangdaliang
2025-05-28 13:54:43 +08:00
parent c71b9d8c63
commit 66c627d33a
2 changed files with 14 additions and 12 deletions

View File

@@ -284,9 +284,10 @@ public class JMeterGroupUtil {
if (executeType == 1) { if (executeType == 1) {
threadGroup.setDuration(pressureSecond); threadGroup.setDuration(pressureSecond);
threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, createLoopController(-1))); threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, createLoopController(-1)));
threadGroup.setProperty(new StringProperty(ThreadGroup.SCHEDULER, "true")); threadGroup.setProperty(new BooleanProperty(ThreadGroup.IS_SAME_USER_ON_NEXT_ITERATION, true));
threadGroup.setProperty(new StringProperty(ThreadGroup.IS_SAME_USER_ON_NEXT_ITERATION, "true")); threadGroup.setScheduler(true);
} else { } else {
threadGroup.setScheduler(false);
threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, createLoopController(loops))); threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, createLoopController(loops)));
} }
if (errorOperType == 1) { if (errorOperType == 1) {
@@ -300,7 +301,6 @@ public class JMeterGroupUtil {
} else if (errorOperType == 5) { } else if (errorOperType == 5) {
threadGroup.setProperty(new StringProperty(ThreadGroup.ON_SAMPLE_ERROR, "stoptestnow")); threadGroup.setProperty(new StringProperty(ThreadGroup.ON_SAMPLE_ERROR, "stoptestnow"));
} }
threadGroup.setScheduler(false);
threadGroup.setProperty(TestElement.TEST_CLASS, ThreadGroup.class.getName()); threadGroup.setProperty(TestElement.TEST_CLASS, ThreadGroup.class.getName());
threadGroup.setProperty(TestElement.GUI_CLASS, ThreadGroupGui.class.getName()); threadGroup.setProperty(TestElement.GUI_CLASS, ThreadGroupGui.class.getName());
threadGroup.setProperty(new BooleanProperty(TestElement.ENABLED, true)); threadGroup.setProperty(new BooleanProperty(TestElement.ENABLED, true));

View File

@@ -145,6 +145,7 @@
<script> <script>
import { editTest, editAndExecuteTest, getTestCaseList, getTestDetail, executeTest } from '../../../api/performance'; import { editTest, editAndExecuteTest, getTestCaseList, getTestDetail, executeTest } from '../../../api/performance';
import {runTestPlanCase} from "../../../api/test/planCase";
export default { export default {
name: "PerformanceEdit", name: "PerformanceEdit",
@@ -262,17 +263,18 @@ export default {
}, },
// 立即执行 // 立即执行
handleWithExecute() { handleWithExecute() {
this.loading = true; const myId = this.$route.query.id;
executeTest(this.$route.query.id).then(res => { this.$modal.confirm('是否确认立即执行性能测试?').then(function () {
if (res.code === 200) { return executeTest(myId);
this.$message({ message: '执行成功', type: 'success' }) }).then((res) => {
// this.$tab.closeOpenPage({ path: "/performance/performance" }); if (res.code === 200) {
} else { this.$modal.msgSuccess("提交执行成功");
this.$message({ message: '执行失败', type: 'error' }) } else {
} this.$message({ message: '提交执行失败', type: 'error' })
}
}).finally(() => { }).finally(() => {
this.loading = false; this.loading = false;
}) });
}, },
// 取消 // 取消
handleWithCancel() { handleWithCancel() {