CalvinKirs commented on code in PR #28058: URL: https://github.com/apache/doris/pull/28058#discussion_r1416846861
########## regression-test/suites/job_p0/test_base_insert_job.groovy: ########## @@ -65,37 +65,40 @@ suite("test_base_insert_job") { "replication_allocation" = "tag.location.default: 1" ); """ - def currentMs=System.currentTimeMillis()+1000; + // Enlarge this parameter to avoid other factors that cause time verification to fail when submitting. + def currentMs=System.currentTimeMillis()+20000; def dateTime = LocalDateTime.ofInstant(Instant.ofEpochMilli(currentMs), ZoneId.systemDefault()); def formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); def startTime= dateTime.format(formatter); def dataCount = sql """select count(*) from ${tableName}""" assert dataCount.get(0).get(0) == 0 sql """ - CREATE JOB ${jobName} ON SCHEDULER at '${startTime}' comment 'test for test&68686781jbjbhj//ncsa' DO insert into ${tableName} values ('2023-07-19', sleep(1000), 1001); + CREATE JOB ${jobName} ON SCHEDULER at '${startTime}' comment 'test for test&68686781jbjbhj//ncsa' DO insert into ${tableName} values ('2023-07-19', sleep(10000), 1001); """ - Thread.sleep(3000) - + Thread.sleep(25000) + def onceJob = sql """select * from jobs("type"="insert") where Name='${jobName}'""" + assert onceJob.size() == 1 + def onceJobId= onceJob.get(0).get(0); // test cancel task - def datas = sql """show job tasks for ${jobName}""" + def datas = sql """select * from tasks("type"="insert") where jobid= ${onceJobId}""" Review Comment: done ########## fe/fe-core/src/main/java/org/apache/doris/job/extensions/insert/InsertTask.java: ########## @@ -38,24 +38,19 @@ import com.google.common.base.Joiner; import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; -import com.google.common.collect.Lists; import lombok.Getter; import lombok.Setter; import lombok.extern.log4j.Log4j2; -import java.util.ArrayList; -import java.util.List; import java.util.Optional; import java.util.UUID; import java.util.concurrent.atomic.AtomicBoolean; -/** - * todo implement this later - */ @Log4j2 public class InsertTask extends AbstractTask { public static final ImmutableList<Column> SCHEMA = ImmutableList.of( + new Column("JobId", ScalarType.createStringType()), Review Comment: done -- 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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org