Skip to content

[Chore] Unit-Test optimize#18214

Merged
SbloodyS merged 12 commits intoapache:devfrom
SbloodyS:ut_performance_optimize
May 6, 2026
Merged

[Chore] Unit-Test optimize#18214
SbloodyS merged 12 commits intoapache:devfrom
SbloodyS:ut_performance_optimize

Conversation

@SbloodyS
Copy link
Copy Markdown
Member

@SbloodyS SbloodyS commented May 2, 2026

Was this PR generated or assisted by AI?

Yes.

Purpose of the pull request

  • Adding parallel execution of intergration tests.
  • The WorkflowStartTestCase is divided into multiple test cases for parallel execution base of the use case.

The test execution time was reduced from 30 minutes to 11 minutes.

  • The console adds test cases for printing execution.
[INFO] org.apache.dolphinscheduler.server.master.integration.cases.WorkflowInstanceFailoverTestCase.testGlobalFailover_runningWorkflow_fromAnotherMaster -- Time elapsed: 4.548 s
[INFO] org.apache.dolphinscheduler.server.master.integration.cases.WorkflowInstanceFailoverTestCase.testGlobalFailover_runningWorkflow_withDispatchTasks -- Time elapsed: 9.075 s
[INFO] org.apache.dolphinscheduler.server.master.integration.cases.WorkflowInstanceFailoverTestCase.testMasterFailover_readyPauseWorkflow_takeOverSubWorkflowOnChildNotHealthy -- Time elapsed: 4.165 s
[INFO] org.apache.dolphinscheduler.server.master.integration.cases.WorkflowInstanceFailoverTestCase.testGlobalFailover_readyStopWorkflow_withSubmittedTasks -- Time elapsed: 3.333 s
[INFO] org.apache.dolphinscheduler.server.master.integration.cases.WorkflowInstanceFailoverTestCase.testGlobalFailover_readyPauseWorkflow_withFailedTasks -- Time elapsed: 3.333 s
[INFO] org.apache.dolphinscheduler.server.master.integration.cases.WorkflowInstanceFailoverTestCase.testMasterFailover_runningWorkflow_takeOverSubWorkflowOnParentHealthy -- Time elapsed: 13.66 s
[INFO] org.apache.dolphinscheduler.server.master.integration.cases.WorkflowInstanceFailoverTestCase.testMasterFailover_readyStopWorkflow_takeOverSubWorkflowOnChildNotHealthy -- Time elapsed: 4.142 s
[INFO] Running org.apache.dolphinscheduler.server.master.integration.cases.WorkflowStartTaskGroupTestCase

Brief change log

Verify this pull request

This pull request is code cleanup without any test coverage.

(or)

This pull request is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(or)

Pull Request Notice

Pull Request Notice

If your pull request contains incompatible change, you should also add it to docs/docs/en/guide/upgrade/incompatible.md

@SbloodyS SbloodyS added this to the 3.4.2 milestone May 2, 2026
@SbloodyS SbloodyS self-assigned this May 2, 2026
@SbloodyS SbloodyS marked this pull request as draft May 2, 2026 14:47
@SbloodyS SbloodyS marked this pull request as ready for review May 4, 2026 10:06
Comment thread dolphinscheduler-master/pom.xml
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR optimizes the dolphinscheduler-master integration test suite by splitting a large workflow-start integration test class into multiple smaller test classes and running those integration tests in parallel forks via Surefire, while also improving CI test output visibility.

Changes:

  • Split WorkflowStartTestCase into multiple focused *TestCase classes to enable parallel execution.
  • Add host normalization in YAML test context initialization to support per-fork master listen ports.
  • Configure Surefire to run integration tests with forkCount=4, and update CI to print per-test execution info.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/WorkflowTestCaseContextFactory.java Normalizes placeholder master address in YAML fixtures to the runtime masterConfig address for forked test runs.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTimeoutTestCase.java New focused integration tests for timeout/alert scenarios, extracted from the previous monolithic test class.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTestCase.java Removed large monolithic workflow-start integration test class (split into smaller classes).
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartTaskGroupTestCase.java New focused integration tests for task group behavior.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartSwitchTestCase.java New focused integration tests for switch task behavior.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartSubWorkflowTestCase.java New focused integration tests for sub-workflow behavior.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartSerialStrategyTestCase.java New focused integration tests for serial start strategies and serial graphs.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartParameterTestCase.java New focused integration tests for workflow/command parameter behaviors.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartGraphTestCase.java New focused integration tests for graph traversal/dependency behaviors.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartDispatchPolicyTestCase.java New focused integration tests for dispatch policy edge cases.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartConditionTestCase.java New focused integration tests for condition task behaviors.
dolphinscheduler-master/src/test/java/org/apache/dolphinscheduler/server/master/integration/cases/WorkflowStartBasicTestCase.java New focused integration tests for basic workflow start scenarios.
dolphinscheduler-master/pom.xml Adds Surefire executions to separate unit vs integration tests and runs integration tests in parallel forks with per-fork H2 DB and ports.
.github/workflows/unit-test.yml Enables more verbose/console-friendly Surefire output in CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread dolphinscheduler-master/pom.xml
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@SbloodyS SbloodyS requested a review from ruanwenjun May 6, 2026 01:53
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

Copy link
Copy Markdown
Member

@ruanwenjun ruanwenjun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ruanwenjun ruanwenjun requested review from Copilot and ruanwenjun May 6, 2026 05:42
@ruanwenjun ruanwenjun added the improvement make more easy to user or prompt friendly label May 6, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated no new comments.

@SbloodyS SbloodyS merged commit 0055001 into apache:dev May 6, 2026
131 of 133 checks passed
@SbloodyS SbloodyS deleted the ut_performance_optimize branch May 6, 2026 05:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend chore CI&CD improvement make more easy to user or prompt friendly test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants