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

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


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

commit 3fc14c5071c1ceb2ea0b69477c9488a537510255
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Fri Jan 10 10:44:12 2025 +0800

    branch-2.1: [regression-test](fix) fix 
test_default_current_timestamp.groovy #46700 (#46729)
    
    Cherry-picked from #46700
    
    Co-authored-by: shuke <sh...@selectdb.com>
---
 .../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: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to