Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
4ad8d8c
[Improvement][Master] Add IT case for task timeout alert (#17843)
shrihari7396 Feb 25, 2026
c6f6ed8
[Improvement-17843][Master] Add IT case for task timeout alert
shrihari7396 Feb 26, 2026
b04d3c7
Merge branch 'dev' into feature/17843-task-timeout-alert-it
SbloodyS Feb 26, 2026
391416c
Added Apache Header ...
shrihari7396 Feb 26, 2026
9e75a32
Issues Resolved In testCase Evaluation ...
shrihari7396 Feb 26, 2026
8c3bc78
Formatting Done Completely
shrihari7396 Feb 26, 2026
928a0da
Extra Space Has been removed
shrihari7396 Feb 27, 2026
b9c72db
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Feb 27, 2026
189b8c7
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Feb 27, 2026
5b694a3
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Feb 28, 2026
97e9a47
Add DB assertion for alert event in timeout warn failed workflow test
shrihari7396 Mar 2, 2026
e856d04
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 2, 2026
faa9b92
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 2, 2026
43ae69c
Merge remote-tracking branch 'fork/feature/17843-task-timeout-alert-i…
shrihari7396 Mar 2, 2026
c2b2aed
Remove commented-out code to fix Sonar issue
shrihari7396 Mar 3, 2026
cc0c80e
Exclude aliyun OSS link from lychee check (504 in CI)
shrihari7396 Mar 3, 2026
7d08b73
Restore public modifier in test methods for consistency with existing…
shrihari7396 Mar 3, 2026
63183e7
Unnessnary changes Reverted.
shrihari7396 Mar 5, 2026
925dc36
DB Assersation Completed ....
shrihari7396 Mar 5, 2026
edd5365
Alert Assertion is added ...
shrihari7396 Mar 6, 2026
ead9dcd
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 6, 2026
ff48869
Update test to assert alert type instead of only alert count
shrihari7396 Mar 6, 2026
6b42009
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 11, 2026
8eda77f
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 11, 2026
5c0334f
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 12, 2026
21fd2ab
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 14, 2026
1af2aca
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 16, 2026
5f76638
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 16, 2026
cfe8dd7
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Mar 18, 2026
9a8541c
Merge branch 'dev' into feature/17843-task-timeout-alert-it
SbloodyS Mar 18, 2026
df22827
Merged Conflicts resolved ...
shrihari7396 Apr 6, 2026
b3c3d36
Test Cases Fixed Correctly ...
shrihari7396 Apr 6, 2026
1b5e767
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 7, 2026
ce0e6f2
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 7, 2026
890e741
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 7, 2026
373c189
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 8, 2026
8b63d2f
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 9, 2026
427b9fe
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 10, 2026
62afd01
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 11, 2026
96e318b
Merge branch 'dev' into feature/17843-task-timeout-alert-it
shrihari7396 Apr 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1861,4 +1861,107 @@ public void testWorkflowTimeout_WithAlertGroup_ShouldSendAlert() {

masterContainer.assertAllResourceReleased();
}
@Test
@DisplayName("Test start a workflow which contains a dep task with timeout warn strategy")
public void testStartWorkflow_withTimeoutWarnTask() {
masterConfig.getServerLoadProtection().setEnabled(false);

final String yaml = "/it/start/workflow_with_timeout_warn_task.yaml";
final WorkflowTestCaseContext context = workflowTestCaseContextFactory.initializeContextFromYaml(yaml);
final WorkflowDefinition workflow = context.getWorkflow("workflow_with_timeout_warn_task");

final WorkflowOperator.WorkflowTriggerDTO workflowTriggerDTO = WorkflowOperator.WorkflowTriggerDTO
.builder()
.workflowDefinition(workflow)
.runWorkflowCommandParam(new RunWorkflowCommandParam())
.warningGroupId(workflow.getWarningGroupId())
.build();

final Integer workflowInstanceId = workflowOperator.manualTriggerWorkflow(workflowTriggerDTO);

await()
.atMost(Duration.ofSeconds(90))
.untilAsserted(() -> {
Assertions
.assertThat(repository.queryWorkflowInstance(workflow))
.satisfiesExactly(workflowInstance -> assertThat(
workflowInstance.getState())
.isEqualTo(WorkflowExecutionStatus.RUNNING_EXECUTION));

Assertions
.assertThat(repository.queryTaskInstance(workflow))
.hasSize(1)
.satisfiesExactly(taskInstance -> {
assertThat(taskInstance.getName())
.isEqualTo("dep_task_with_timeout_warn");
assertThat(taskInstance.getState())
.isEqualTo(TaskExecutionStatus.RUNNING_EXECUTION);
});

Assertions
.assertThat(repository.queryAlert(workflowInstanceId))
.isNotEmpty()
.anySatisfy(alert -> {
assertThat(alert.getAlertType())
.isEqualTo(AlertType.TASK_TIMEOUT);
});
});

workflowOperator.stopWorkflowInstance(workflowInstanceId);
await()
.atMost(Duration.ofSeconds(30))
.untilAsserted(() -> Assertions.assertThat(repository.queryWorkflowInstance(workflowInstanceId))
.matches(w -> w.getState() == WorkflowExecutionStatus.STOP));
masterContainer.assertAllResourceReleased();
}

@Test
@DisplayName("Test start a workflow which contains a dep task with timeout warn failed strategy")
public void testStartWorkflow_withTimeoutWarnFailedTask() {
masterConfig.getServerLoadProtection().setEnabled(false);

final String yaml = "/it/start/workflow_with_timeout_warnfailed_task.yaml";
final WorkflowTestCaseContext context = workflowTestCaseContextFactory.initializeContextFromYaml(yaml);
final WorkflowDefinition workflow = context.getWorkflow("workflow_with_timeout_warnfailed_task");

final WorkflowOperator.WorkflowTriggerDTO workflowTriggerDTO = WorkflowOperator.WorkflowTriggerDTO
.builder()
.workflowDefinition(workflow)
.runWorkflowCommandParam(new RunWorkflowCommandParam())
.warningGroupId(workflow.getWarningGroupId())
.build();

final Integer workflowInstanceId = workflowOperator.manualTriggerWorkflow(workflowTriggerDTO);

await()
.atMost(Duration.ofSeconds(90))
.untilAsserted(() -> {
Assertions
.assertThat(repository.queryWorkflowInstance(workflow))
.satisfiesExactly(workflowInstance -> assertThat(
workflowInstance.getState())
.isEqualTo(WorkflowExecutionStatus.STOP));

Assertions
.assertThat(repository.queryTaskInstance(workflow))
.hasSize(1)
.satisfiesExactly(taskInstance -> {
assertThat(taskInstance.getName())
.isEqualTo("dep_task_with_timeout_warnfailed");
assertThat(taskInstance.getState())
.isEqualTo(TaskExecutionStatus.KILL);
});

Assertions
.assertThat(repository.queryAlert(workflowInstanceId))
.isNotEmpty()
.anySatisfy(alert -> {
assertThat(alert.getAlertType())
.isEqualTo(AlertType.TASK_TIMEOUT);
});
});

masterContainer.assertAllResourceReleased();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

project:
name: MasterIntegrationTest
code: 1
description: This is a fake project
userId: 1
userName: admin
createTime: 2024-08-12 00:00:00
updateTime: 2021-08-12 00:00:00

workflows:
- name: workflow_with_timeout_warn_task
code: 1
version: 1
projectCode: 1
description: This is a fake workflow with single timeout warn task
releaseState: ONLINE
warningGroupId: 1
createTime: 2024-08-12 00:00:00
updateTime: 2021-08-12 00:00:00
userId: 1
executionType: PARALLEL

tasks:
- name: dep_task_with_timeout_warn
code: 1
version: 1
projectCode: 1
userId: 1
timeoutFlag: 'OPEN'
timeoutNotifyStrategy: 'WARN'
timeout: 1
taskType: DEPENDENT
taskParams: '{"localParams":[],"resourceList":[],"dependence":{"checkInterval":10,"failurePolicy":"DEPENDENT_FAILURE_FAILURE","relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"dependentType":"DEPENDENT_ON_WORKFLOW","projectCode":1,"definitionCode":1,"depTaskCode":0,"cycle":"day","dateValue":"last1Days"}]}]}}'
workerGroup: default
createTime: 2024-08-12 00:00:00
updateTime: 2021-08-12 00:00:00
taskExecuteType: BATCH

taskRelations:
- projectCode: 1
workflowDefinitionCode: 1
workflowDefinitionVersion: 1
preTaskCode: 0
preTaskVersion: 0
postTaskCode: 1
postTaskVersion: 1
createTime: 2024-08-12 00:00:00
updateTime: 2024-08-12 00:00:00
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

project:
name: MasterIntegrationTest
code: 1
description: This is a fake project
userId: 1
userName: admin
createTime: 2024-08-12 00:00:00
updateTime: 2021-08-12 00:00:00

workflows:
- name: workflow_with_timeout_warnfailed_task
code: 1
version: 1
projectCode: 1
description: This is a fake workflow with single timeout warnfailed task
releaseState: ONLINE
warningGroupId: 1
createTime: 2024-08-12 00:00:00
updateTime: 2021-08-12 00:00:00
userId: 1
executionType: PARALLEL

tasks:
- name: dep_task_with_timeout_warnfailed
code: 1
version: 1
projectCode: 1
userId: 1
timeoutFlag: 'OPEN'
timeoutNotifyStrategy: 'WARNFAILED'
timeout: 1
taskType: DEPENDENT
taskParams: '{"localParams":[],"resourceList":[],"dependence":{"checkInterval":10,"failurePolicy":"DEPENDENT_FAILURE_FAILURE","relation":"AND","dependTaskList":[{"relation":"AND","dependItemList":[{"dependentType":"DEPENDENT_ON_WORKFLOW","projectCode":1,"definitionCode":1,"depTaskCode":0,"cycle":"day","dateValue":"last1Days"}]}]}}'
workerGroup: default
createTime: 2024-08-12 00:00:00
updateTime: 2021-08-12 00:00:00
taskExecuteType: BATCH

taskRelations:
- projectCode: 1
workflowDefinitionCode: 1
workflowDefinitionVersion: 1
preTaskCode: 0
preTaskVersion: 0
postTaskCode: 1
postTaskVersion: 1
createTime: 2024-08-12 00:00:00
updateTime: 2024-08-12 00:00:00
Loading