KwongHing commented on code in PR #17614:
URL:
https://github.com/apache/dolphinscheduler/pull/17614#discussion_r2488985919
##########
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:
I’ve directly asserted the priority number here as suggested. @SbloodyS
--
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]