This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new 432286f2ae3 branch-3.0: [regression-test](fix) fix 
test_default_current_timestamp.groovy #46700 (#46728)
432286f2ae3 is described below

commit 432286f2ae3c22825c22a87116e16593e600af22
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jan 13 22:02:45 2025 +0800

    branch-3.0: [regression-test](fix) fix 
test_default_current_timestamp.groovy #46700 (#46728)
    
    Cherry-picked from #46700
    
    Co-authored-by: shuke <[email protected]>
---
 .../datatype_p0/date/test_default_current_timestamp.groovy | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git 
a/regression-test/suites/datatype_p0/date/test_default_current_timestamp.groovy 
b/regression-test/suites/datatype_p0/date/test_default_current_timestamp.groovy
index 21e61a1ef25..666aa189c68 100644
--- 
a/regression-test/suites/datatype_p0/date/test_default_current_timestamp.groovy
+++ 
b/regression-test/suites/datatype_p0/date/test_default_current_timestamp.groovy
@@ -16,7 +16,21 @@
 // specific language governing permissions and limitations
 // under the License.
 
+import java.time.LocalTime
+import java.time.format.DateTimeFormatter
+import java.time.Duration
+
 suite("test_default_current_timestamp") {
+    // This case assumes that the execution will not cross 24:00 during 
runtime. 
+    // Therefore, if the execution time is greater than 23:59:30, it will wait 
until 24:00 to proceed.
+    def t = sql "select now()"
+    LocalTime currentTime = t[0][0].toLocalTime()
+    if (currentTime.isAfter(LocalTime.of(23, 59, 30))) {
+        def s = Duration.between(currentTime, LocalTime.of(23, 59, 
59)).seconds + 2
+        logger.info("sleep ${s} seconds to 24:00")
+        Thread.sleep(s * 1000)
+    } 
+
     def tbName = "test_default_current_timestamp"
     sql "DROP TABLE IF EXISTS ${tbName}"
     sql """


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to