解决测试计划性能测试相关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) {
threadGroup.setDuration(pressureSecond);
threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, createLoopController(-1)));
threadGroup.setProperty(new StringProperty(ThreadGroup.SCHEDULER, "true"));
threadGroup.setProperty(new StringProperty(ThreadGroup.IS_SAME_USER_ON_NEXT_ITERATION, "true"));
threadGroup.setProperty(new BooleanProperty(ThreadGroup.IS_SAME_USER_ON_NEXT_ITERATION, true));
threadGroup.setScheduler(true);
} else {
threadGroup.setScheduler(false);
threadGroup.setProperty(new TestElementProperty(ThreadGroup.MAIN_CONTROLLER, createLoopController(loops)));
}
if (errorOperType == 1) {
@@ -300,7 +301,6 @@ public class JMeterGroupUtil {
} else if (errorOperType == 5) {
threadGroup.setProperty(new StringProperty(ThreadGroup.ON_SAMPLE_ERROR, "stoptestnow"));
}
threadGroup.setScheduler(false);
threadGroup.setProperty(TestElement.TEST_CLASS, ThreadGroup.class.getName());
threadGroup.setProperty(TestElement.GUI_CLASS, ThreadGroupGui.class.getName());
threadGroup.setProperty(new BooleanProperty(TestElement.ENABLED, true));

View File

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