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

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


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 5a42cee2b49 branch-3.1: [fix](case)Use relative cooldown time instead 
of absolutetime in storage policy test case #51572 (#52487)
5a42cee2b49 is described below

commit 5a42cee2b49db0a727107b924c4f1fd009d8a527
Author: Calvin Kirs <[email protected]>
AuthorDate: Mon Jun 30 18:59:06 2025 +0800

    branch-3.1: [fix](case)Use relative cooldown time instead of absolutetime 
in storage policy test case #51572 (#52487)
    
    Cherry-picked from #51572
---
 .../suites/cold_heat_separation/policy/drop.groovy          | 13 +++++++++----
 .../cold_heat_separation/policy/drop_hdfs_reource.groovy    | 12 ++++++++----
 2 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/regression-test/suites/cold_heat_separation/policy/drop.groovy 
b/regression-test/suites/cold_heat_separation/policy/drop.groovy
index 6879e4891af..c7a178588ab 100644
--- a/regression-test/suites/cold_heat_separation/policy/drop.groovy
+++ b/regression-test/suites/cold_heat_separation/policy/drop.groovy
@@ -15,6 +15,10 @@
 // specific language governing permissions and limitations
 // under the License.
 
+import java.time.ZoneId
+import java.time.ZonedDateTime
+import java.time.format.DateTimeFormatter
+
 suite("drop_policy") {
     def storage_exist = { name ->
         def show_storage_policy = sql """
@@ -84,7 +88,7 @@ suite("drop_policy") {
             CREATE STORAGE POLICY ${use_policy}
             PROPERTIES(
             "storage_resource" = "${resource_table_use}",
-            "cooldown_datetime" = "2025-06-08 00:00:00"
+            "cooldown_datetime" = "2035-06-08 00:00:00"
             );
         """
         assertEquals(storage_exist.call(use_policy), true)
@@ -100,12 +104,13 @@ suite("drop_policy") {
         """
         // can drop, no table use
         assertEquals(drop_policy_ret.size(), 1)
-
+        def zonedDateTime = ZonedDateTime.now(ZoneId.of("UTC")).plusYears(1)
+        def futureTime = 
zonedDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
         def create_succ_2 = try_sql """
             CREATE STORAGE POLICY IF NOT EXISTS 
drop_policy_test_has_table_binded
             PROPERTIES(
             "storage_resource" = "${resource_table_use}",
-            "cooldown_datetime" = "2025-06-08 00:00:00"
+            "cooldown_datetime" = "${futureTime}"
             );
         """
         assertEquals(storage_exist.call("drop_policy_test_has_table_binded"), 
true)
@@ -114,7 +119,7 @@ suite("drop_policy") {
             CREATE STORAGE POLICY IF NOT EXISTS 
drop_policy_test_has_table_bind_1
             PROPERTIES(
             "storage_resource" = "${resource_table_use}",
-            "cooldown_datetime" = "2025-06-08 00:00:00"
+            "cooldown_datetime" = "${futureTime}"
             );
         """
         assertEquals(storage_exist.call("drop_policy_test_has_table_bind_1"), 
true)
diff --git 
a/regression-test/suites/cold_heat_separation/policy/drop_hdfs_reource.groovy 
b/regression-test/suites/cold_heat_separation/policy/drop_hdfs_reource.groovy
index 39bbaf09e7a..78f3dd70756 100644
--- 
a/regression-test/suites/cold_heat_separation/policy/drop_hdfs_reource.groovy
+++ 
b/regression-test/suites/cold_heat_separation/policy/drop_hdfs_reource.groovy
@@ -14,6 +14,9 @@
 // KIND, either express or implied.  See the License for the
 // specific language governing permissions and limitations
 // under the License.
+import java.time.ZonedDateTime
+import java.time.format.DateTimeFormatter
+import java.time.ZoneId
 
 suite("drop_hdfs_policy") {
     def storage_exist = { name ->
@@ -74,13 +77,15 @@ suite("drop_hdfs_policy") {
             "dfs.client.failover.proxy.provider" = 
"org.apache.hadoop.hdfs.server.namenode.ha.ConfiguredFailoverProxyProvider"
         );
         """
-
+        def zonedDateTime = ZonedDateTime.now(ZoneId.of("UTC")).plusYears(1)
+      
+        def futureTime = 
zonedDateTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"))
 
         def create_succ_1 = try_sql """
             CREATE STORAGE POLICY ${use_policy}
             PROPERTIES(
             "storage_resource" = "${resource_table_use}",
-            "cooldown_datetime" = "2025-06-08 00:00:00"
+            "cooldown_datetime" = "${futureTime}"
             );
         """
         assertEquals(storage_exist.call(use_policy), true)
@@ -96,12 +101,11 @@ suite("drop_hdfs_policy") {
         """
         // can drop, no table use
         assertEquals(drop_policy_ret.size(), 1)
-
         def create_succ_2 = try_sql """
             CREATE STORAGE POLICY IF NOT EXISTS 
drop_policy_test_has_table_binded_hdfs
             PROPERTIES(
             "storage_resource" = "${resource_table_use}",
-            "cooldown_datetime" = "2025-06-08 00:00:00"
+            "cooldown_datetime" = "${futureTime}"
             );
         """
         
assertEquals(storage_exist.call("drop_policy_test_has_table_binded_hdfs"), true)


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

Reply via email to