ruanwenjun opened a new issue, #18269: URL: https://github.com/apache/dolphinscheduler/issues/18269
### Search before asking - [x] I had searched in the [issues](https://github.com/apache/dolphinscheduler/issues?q=is%3Aissue) and found no similar issues. ### What happened `LogicFakeTask` is intended for master integration tests, but its implementation and plugin registration code are currently compiled from main sources. The test-only fake task code is packaged into production artifacts through these paths: - `dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/fake/LogicFakeTask.java` - `dolphinscheduler-master/src/main/java/org/apache/dolphinscheduler/server/master/engine/executor/plugin/fake/LogicFakeTaskPluginFactory.java` - `dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/task/LogicFakeTaskChannelFactory.java` - `dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/task/LogicFakeTaskChannel.java` - `dolphinscheduler-task-plugin/dolphinscheduler-task-api/src/main/java/org/apache/dolphinscheduler/plugin/task/api/parameters/LogicFakeTaskParameters.java` Because `LogicFakeTaskChannelFactory` is registered as a `TaskChannelFactory`, `TaskPluginManager` can load `LogicFakeTask` from the production classpath. As a result, users may see or create a task type that should only exist for integration tests. ### What you expected to happen `LogicFakeTask` should be available only to master integration tests. It should not be packaged into production binaries and should not be registered as a production task type. Master integration tests should still be able to use `LogicFakeTask`, but the fake task implementation, channel, parameters, and factory should live under test scope. ### How to reproduce 1. Build or run DolphinScheduler from the dev branch. 2. Inspect the generated `dolphinscheduler-task-api` service registration for `org.apache.dolphinscheduler.plugin.task.api.TaskChannelFactory`, or load task plugins through `TaskPluginManager`. 3. Observe that `LogicFakeTaskChannelFactory` is registered from the production classpath. 4. `TaskPluginManager.getTaskChannel("LogicFakeTask")` can resolve the fake task channel, even though it is intended only for master integration tests. ### Anything else A fix should move the fake task implementation and related task channel/parameter code to test scope, and add a regression test to ensure `LogicFakeTask` is not loaded by the production `TaskPluginManager`. ### Version dev ### Are you willing to submit PR? - [x] Yes I am willing to submit a PR! ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- 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]
