ruanwenjun commented on code in PR #17614:
URL:
https://github.com/apache/dolphinscheduler/pull/17614#discussion_r2501808376
##########
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java:
##########
@@ -141,15 +145,32 @@ public void
testStartWorkflow_with_oneSuccessTaskUsingTaskGroup() {
workflowOperator.manualTriggerWorkflow(workflowTriggerDTO);
workflowOperator.manualTriggerWorkflow(workflowTriggerDTO);
+ final TaskDefinition taskDefinition = context.getTasks().get(0);
+ final Map<Integer, TaskGroupQueue> taskGroupQueueMap = new HashMap<>();
+
await()
.atMost(Duration.ofMinutes(2))
.atLeast(Duration.ofSeconds(20))
.untilAsserted(() -> {
+
+ // Capture TaskGroupQueue records during execution since
they are deleted after task completion.
+
repository.queryAllInQueueTaskGroupQueue().forEach(taskGroupQueue -> {
+ taskGroupQueueMap.put(taskGroupQueue.getId(),
taskGroupQueue);
+ });
Review Comment:
It's better to remove this assertion, this might easily failure. If we want
to do this assertion we should avoid delete this in db in ci.
##########
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java:
##########
@@ -141,15 +145,32 @@ public void
testStartWorkflow_with_oneSuccessTaskUsingTaskGroup() {
workflowOperator.manualTriggerWorkflow(workflowTriggerDTO);
workflowOperator.manualTriggerWorkflow(workflowTriggerDTO);
+ final TaskDefinition taskDefinition = context.getTasks().get(0);
+ final Map<Integer, TaskGroupQueue> taskGroupQueueMap = new HashMap<>();
+
await()
.atMost(Duration.ofMinutes(2))
.atLeast(Duration.ofSeconds(20))
.untilAsserted(() -> {
+
+ // Capture TaskGroupQueue records during execution since
they are deleted after task completion.
+
repository.queryTaskGroupQueue(workflow).forEach(taskGroupQueue -> {
+ taskGroupQueueMap.put(taskGroupQueue.getId(),
taskGroupQueue);
+ });
+
Assertions
.assertThat(repository.queryTaskInstance(workflow))
.hasSize(4)
.allMatch(taskInstance ->
TaskExecutionStatus.SUCCESS.equals(taskInstance.getState())
&& taskInstance.getTaskGroupId() ==
context.getTaskGroups().get(0).getId());
+
+ Assertions
+ .assertThat(taskGroupQueueMap)
+ .hasSize(4)
+ .allSatisfy((id, taskGroupQueue) -> {
+
assertThat(taskGroupQueue.getGroupId()).isEqualTo(taskDefinition.getTaskGroupId());
+
assertThat(taskGroupQueue.getPriority()).isEqualTo(1);
Review Comment:
You should remove unused method.
##########
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/repository/TaskGroupQueueDao.java:
##########
@@ -92,4 +92,13 @@ public interface TaskGroupQueueDao extends
IDao<TaskGroupQueue> {
* @return TaskGroupQueue ordered by priority desc
*/
List<TaskGroupQueue> queryWaitNotifyForceStartTaskGroupQueue(int
minTaskGroupQueueId, int limit);
+
+ /**
+ * Query all {@link TaskGroupQueue} belonging to the specified workflow
instance.
+ *
+ * @param workflowInstanceId workflowInstanceId
+ * @return TaskGroupQueue
+ */
+ List<TaskGroupQueue> queryByWorkflowInstanceId(Integer workflowInstanceId);
+
Review Comment:
it's better to remove this method.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]