Unverified Commit d6798c6d authored by qiaozhanwei's avatar qiaozhanwei Committed by GitHub
Browse files

1,task status statistics and process status statistics bug fix (#2357) ...


1,task status statistics and process status statistics bug fix (#2357)  2,worker group bug fix (#2430)

* dispatch task fail will set task status failed

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,no worker condition , master will while ture wait for worker startup
2,worker response task status sync wait for result

* 1,task status statistics and process status statistics bug fix (#2357)
2,worker group bug fix

* 1,task status statistics and process status statistics bug fix (#2357)
2,worker group bug fix

* 1,task status statistics and process status statistics bug fix (#2357)
2,worker group bug fix

* 1,task status statistics and process status statistics bug fix (#2357)
2,worker group bug fix

Co-authored-by: default avatarqiaozhanwei <qiaozhanwei@analysys.com.cn>
parent 8b4eb20b
Loading
Loading
Loading
Loading
+5 −9
Original line number Diff line number Diff line
@@ -106,12 +106,10 @@ public class DataAnalysisService extends BaseService{
        List<ExecuteStatusCount> taskInstanceStateCounts =
                taskInstanceMapper.countTaskInstanceStateByUser(start, end, projectIds);

        if (taskInstanceStateCounts != null && !taskInstanceStateCounts.isEmpty()) {
        if (taskInstanceStateCounts != null) {
            TaskCountDto taskCountResult = new TaskCountDto(taskInstanceStateCounts);
            result.put(Constants.DATA_LIST, taskCountResult);
            putMsg(result, Status.SUCCESS);
        } else {
            putMsg(result, Status.TASK_INSTANCE_STATE_COUNT_ERROR);
        }
        return result;
    }
@@ -153,12 +151,10 @@ public class DataAnalysisService extends BaseService{
                processInstanceMapper.countInstanceStateByUser(start, end,
                        projectIdArray);

        if (processInstanceStateCounts != null && !processInstanceStateCounts.isEmpty()) {
        if (processInstanceStateCounts != null) {
            TaskCountDto taskCountResult = new TaskCountDto(processInstanceStateCounts);
            result.put(Constants.DATA_LIST, taskCountResult);
            putMsg(result, Status.SUCCESS);
        } else {
            putMsg(result, Status.COUNT_PROCESS_INSTANCE_STATE_ERROR);
        }
        return result;
    }
+0 −7
Original line number Diff line number Diff line
@@ -114,9 +114,6 @@ public class DataAnalysisServiceTest {
        Map<String, Object> result = dataAnalysisService.countTaskStateByProject(user, 2, startDate, endDate);
        Assert.assertTrue(result.isEmpty());

        // task instance state count error
        result = dataAnalysisService.countTaskStateByProject(user, 1, startDate, endDate);
        Assert.assertEquals(Status.TASK_INSTANCE_STATE_COUNT_ERROR,result.get(Constants.STATUS));

        //SUCCESS
        Mockito.when(taskInstanceMapper.countTaskInstanceStateByUser(DateUtils.getScheduleDate(startDate),
@@ -137,10 +134,6 @@ public class DataAnalysisServiceTest {
        Map<String, Object> result = dataAnalysisService.countProcessInstanceStateByProject(user,2,startDate,endDate);
        Assert.assertTrue(result.isEmpty());

        //COUNT_PROCESS_INSTANCE_STATE_ERROR
        result = dataAnalysisService.countProcessInstanceStateByProject(user,1,startDate,endDate);
        Assert.assertEquals(Status.COUNT_PROCESS_INSTANCE_STATE_ERROR,result.get(Constants.STATUS));

        //SUCCESS
        Mockito.when(processInstanceMapper.countInstanceStateByUser(DateUtils.getScheduleDate(startDate),
                DateUtils.getScheduleDate(endDate), new Integer[]{1})).thenReturn(getTaskInstanceStateCounts());
+10 −0
Original line number Diff line number Diff line
@@ -223,4 +223,14 @@ public class ThreadUtils {
        }
        return id + " (" + name + ")";
    }

    /**
     * sleep
     * @param millis millis
     */
    public static void sleep(final long millis) {
        try {
            Thread.sleep(millis);
        } catch (final InterruptedException ignore) {}
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -111,7 +111,7 @@ public class Command {
    /**
     * worker group
     */
    @TableField(exist = false)
    @TableField("worker_group")
    private String workerGroup;

    public Command() {
+4 −9
Original line number Diff line number Diff line
@@ -76,7 +76,8 @@ public class CommandMapperTest {
        //query
        Command actualCommand = commandMapper.selectById(expectedCommand.getId());

        assertEquals(expectedCommand, actualCommand);
        assertNotNull(actualCommand);
        assertEquals(expectedCommand.getProcessDefinitionId(), actualCommand.getProcessDefinitionId());
    }

    /**
@@ -94,7 +95,8 @@ public class CommandMapperTest {

        Command actualCommand = commandMapper.selectById(expectedCommand.getId());

        assertEquals(expectedCommand,actualCommand);
        assertNotNull(actualCommand);
        assertEquals(expectedCommand.getUpdateTime(),actualCommand.getUpdateTime());

    }

@@ -127,13 +129,6 @@ public class CommandMapperTest {
        List<Command> actualCommands = commandMapper.selectList(null);

        assertThat(actualCommands.size(), greaterThanOrEqualTo(count));

        for (Command actualCommand : actualCommands){
            Command expectedCommand = commandMap.get(actualCommand.getId());
            if (expectedCommand != null){
                assertEquals(expectedCommand,actualCommand);
            }
        }
    }

    /**
Loading