瀏覽代碼

标准化测试

LingxinMeng 2 年之前
父節點
當前提交
247d3cd6fb

+ 2 - 3
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/application/service/ProjectService.java

@@ -153,7 +153,7 @@ public class ProjectService {
             projectMessageModel.setTaskCompleted(0);
             //去重,之后发送消息的时候会补全指标,如果不去重的话会出现多个场景重复关联多个指标
             Set<SceneEntity> sceneEntitySet = new HashSet<>(sceneEntityList);
-            log.debug("项目 " + projectId + " 场景包括:" + sceneEntitySet);
+            log.info("项目 " + projectId + " 场景包括:" + sceneEntitySet);
             // -------------------------------- 2 算法导入 --------------------------------
             log.info("项目 " + projectId + " 开始算法导入。");
             String algorithmDockerImage = handleAlgorithm(projectId, algorithmId);
@@ -178,7 +178,7 @@ public class ProjectService {
                         lastTargetIdList = indexMapper.selectLeafIndexIdByAutoSubProjectIdAndSceneId(projectId, "%" + sceneId + "%");
                     }
                     if (CollectionUtil.isEmpty(lastTargetIdList)) {
-                        throw new RuntimeException("项目 " + projectId + " 使用的场景测试包 " + sceneId + " 不存在指标。");
+                        throw new RuntimeException("项目 " + projectId + " 使用的场景测试包 " + packageId + " 不存在场景:" + sceneId);
                     }
                     for (String lastTargetId : lastTargetIdList) {
                         String taskId = StringUtil.getRandomUUID();
@@ -309,7 +309,6 @@ public class ProjectService {
 
         } catch (Exception e) {
             log.error("项目报错。", e);
-            stopProject(projectId, projectType, e.getMessage());
             throw new RuntimeException(e);
         }
 

+ 4 - 1
simulation-resource-scheduler/src/main/java/com/css/simulation/resource/scheduler/domain/service/TaskDomainService.java

@@ -310,7 +310,7 @@ public class TaskDomainService {
         headers.put("Authorization", "Bearer " + accessToken);
         Map<String, String> params = new HashMap<>();
         params.put("id", projectId);
-        String post = HttpUtil.post( customConfiguration.getEvaluationLevelUri(), headers, params);
+        String post = HttpUtil.post(customConfiguration.getEvaluationLevelUri(), headers, params);
         log.info("访问仿真云平台评价等级接口:" + customConfiguration.getEvaluationLevelUri() + ",请求头为:" + headers + ",请求体为:" + params + "结果为:" + post);
     }
 
@@ -323,6 +323,9 @@ public class TaskDomainService {
     public void taskTick(String taskId) {
         log.info("收到任务 " + taskId + " 的心跳。");
         TaskEntity taskEntity = taskMapper.selectById(taskId);
+        if (taskEntity == null) {
+            return;
+        }
         String projectId = taskEntity.getPId();
         String projectUserId = taskEntity.getCreateUserId();
         // 刷新 redis 心跳时间