diff --git a/src/main/java/org/bench4q/master/api/TestPlanController.java b/src/main/java/org/bench4q/master/api/TestPlanController.java index 91280bdc..40beddac 100644 --- a/src/main/java/org/bench4q/master/api/TestPlanController.java +++ b/src/main/java/org/bench4q/master/api/TestPlanController.java @@ -109,7 +109,10 @@ public class TestPlanController extends BaseController { UUID testPlanRunID = this.getTestPlanRunner().runTestPlanWithModel( testPlanModel, this.getPrincipal()); - + if (testPlanRunID == null) { + buildResponseModel(TestPlanStatus.ErrorInSubmitTask, null, null, + null); + } return buildResponseModel(this.getTestPlanService() .queryTestPlanStatus(testPlanRunID), testPlanRunID, null, testPlanModel.getMonitorModles()); diff --git a/src/main/java/org/bench4q/master/api/TestPlanStatus.java b/src/main/java/org/bench4q/master/api/TestPlanStatus.java index 7130d198..0c5f4044 100644 --- a/src/main/java/org/bench4q/master/api/TestPlanStatus.java +++ b/src/main/java/org/bench4q/master/api/TestPlanStatus.java @@ -1,5 +1,5 @@ package org.bench4q.master.api; public enum TestPlanStatus { - NotStart, InRunning, Complete, PendingNoEnoughMaxLoad, PendingNoEnoughCurrentLoad, Error + NotStart, InRunning, Complete, PendingNoEnoughMaxLoad, PendingNoEnoughCurrentLoad, Error, ErrorInSubmitTask } diff --git a/src/main/java/org/bench4q/master/testPlan/TestPlanRunner.java b/src/main/java/org/bench4q/master/testPlan/TestPlanRunner.java index 77258aad..15e8daec 100644 --- a/src/main/java/org/bench4q/master/testPlan/TestPlanRunner.java +++ b/src/main/java/org/bench4q/master/testPlan/TestPlanRunner.java @@ -97,10 +97,6 @@ public class TestPlanRunner implements TaskCompleteCallback, ExecutorService executorService = Executors.newCachedThreadPool(); final UUID testPlanId = UUID.randomUUID(); - // final TestPlanContext testPlanContext = new TestPlanContext(); - // testPlanContext.fillScriptMap(testPlanModel.getRunningScriptModels(), - // testPlanId); - // testPlanContext.setTestPlanModel(testPlanModel); final TestPlanContext testPlanContext = new TestPlanContext( testPlanModel, testPlanId); if (!this.testPlanService.saveTestPlanToDB(testPlanModel, user,