sandynz commented on code in PR #23838:
URL: https://github.com/apache/shardingsphere/pull/23838#discussion_r1090442007


##########
test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/base/PipelineBaseE2EIT.java:
##########
@@ -124,12 +124,19 @@ public PipelineBaseE2EIT(final PipelineTestParameter 
testParam) {
         }
         createProxyDatabase(testParam.getDatabaseType());
         if (PipelineEnvTypeEnum.NATIVE == ENV.getItEnvType()) {
+            try {
+                cleanUpPipelineJobs();
+            } catch (final SQLException ex) {
+                throw new RuntimeException(ex);
+            }
             cleanUpDataSource();
         }
         extraSQLCommand = 
JAXB.unmarshal(Objects.requireNonNull(PipelineBaseE2EIT.class.getClassLoader().getResource(testParam.getScenario())),
 ExtraSQLCommand.class);
         pipelineWatcher = new PipelineWatcher(containerComposer);
     }
     
+    protected abstract void cleanUpPipelineJobs() throws SQLException;

Review Comment:
   1, Could we remove this `cleanUpPipelineJobs` method.
   
   2, Add `cleanUpPipelineJobs` here, transfer rollback and commit SQL in 
parameters;
   then `AbstractMigrationE2EIT` add new method to invoke 
`cleanUpPipelineJobs`, e.g. `cleanUpMigrationJobs`,
   and sub-classes could just invoke `cleanUpMigrationJobs`.
   



##########
test/e2e/pipeline/src/test/java/org/apache/shardingsphere/test/e2e/data/pipeline/cases/migration/AbstractMigrationE2EIT.java:
##########
@@ -50,16 +50,10 @@ public abstract class AbstractMigrationE2EIT extends 
PipelineBaseE2EIT {
     public AbstractMigrationE2EIT(final PipelineTestParameter testParam) {
         super(testParam);
         migrationDistSQLCommand = 
JAXB.unmarshal(Objects.requireNonNull(PipelineBaseE2EIT.class.getClassLoader().getResource("env/common/migration-command.xml")),
 MigrationDistSQLCommand.class);
-        if (PipelineEnvTypeEnum.NATIVE == ENV.getItEnvType()) {
-            try {
-                cleanUpPipelineJobs();
-            } catch (final SQLException ex) {
-                throw new RuntimeException(ex);
-            }
-        }
     }
     
-    private void cleanUpPipelineJobs() throws SQLException {
+    @Override
+    protected void cleanUpPipelineJobs() throws SQLException {
         List<String> jobIds = listJobId();
         for (String each : jobIds) {

Review Comment:
   Not only support `rollback`, but also add `commit` in case if job is not 
finished



-- 
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]

Reply via email to