zddr commented on code in PR #28058:
URL: https://github.com/apache/doris/pull/28058#discussion_r1416796653


##########
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:
   You can directly query the corresponding column instead of *,Otherwise, if 
we add or subtract columns in the future, we will have to change the case



##########
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:
   You can directly query the corresponding column instead of *,Otherwise, if 
we add or subtract columns in the future, we will have to change the case



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

Reply via email to