From 83402da62e7075607ad7c37b0add2a5358f4ac13 Mon Sep 17 00:00:00 2001 From: lidongyang Date: Mon, 25 May 2026 17:01:31 +0800 Subject: [PATCH] branch-4.0: [fix](test) solve defined global variables in cloud_p0 suites In several cloud_p0 regression test suites, 'resp' was assigned without the 'def' keyword, making it an implicit global variable. This could cause interference between test cases when tests run in the same Groovy script context. Also rename 'balance_tablet_percent_per_run' to 'cloud_balance_tablet_percent_per_run' in table_rebalance.groovy to use the correct cloud-mode config key. Co-Authored-By: Claude Sonnet 4.6 --- regression-test/suites/cloud_p0/cache/load.groovy | 2 +- .../warm_up/cluster/test_warm_up_cluster_empty.groovy | 2 +- .../multi_cluster/async_copy_into/async_load.groovy | 2 +- .../cloud_p0/multi_cluster/copy_into/sync_laod.groovy | 2 +- .../cloud_p0/multi_cluster/default_cluster.groovy | 2 +- .../multi_cluster/multi_cluster_s3_load/load.groovy | 2 +- .../cloud_p0/multi_cluster/rename_cluster.groovy | 2 +- .../routine_load/test_routine_load.groovy | 2 +- .../test_materialized_view_with_drop_cluster.groovy | 2 +- .../test_materialized_view_with_readd_cluster.groovy | 2 +- .../schema_change/test_rollup_with_drop_cluster.groovy | 2 +- .../test_rollup_with_readd_cluster.groovy | 2 +- .../test_schema_change_with_drop_cluster.groovy | 2 +- .../test_schema_change_with_readd_cluster.groovy | 2 +- .../multi_cluster/stream_load/stream_load.groovy | 2 +- .../multi_cluster/stream_load/stream_load_2pc.groovy | 2 +- .../multi_cluster/stream_load/stream_load_lb.groovy | 2 +- .../cloud_p0/multi_cluster/table_rebalance.groovy | 10 +++++----- .../multi_cluster/test_apsaradb_internal_stage.groovy | 2 +- .../cloud_p0/multi_cluster/test_cloud_cluster.groovy | 2 +- .../cloud_p0/multi_cluster/test_drop_cluster.groovy | 2 +- .../test_group_commit_multi_cluster.groovy | 2 +- .../multi_cluster/test_overdue_instance.groovy | 2 +- 23 files changed, 27 insertions(+), 27 deletions(-) diff --git a/regression-test/suites/cloud_p0/cache/load.groovy b/regression-test/suites/cloud_p0/cache/load.groovy index 9485d16e22dd50..3733809bc6f40c 100644 --- a/regression-test/suites/cloud_p0/cache/load.groovy +++ b/regression-test/suites/cloud_p0/cache/load.groovy @@ -52,7 +52,7 @@ suite("load") { println("the brpc port is " + brpcPortList); for (unique_id : beUniqueIdList) { - def resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy index ba2c510bbb5892..60686dff9e32f1 100644 --- a/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy +++ b/regression-test/suites/cloud_p0/cache/multi_cluster/warm_up/cluster/test_warm_up_cluster_empty.groovy @@ -55,7 +55,7 @@ suite("test_warm_up_cluster_empty") { println("the brpc port is " + brpcPortList); for (unique_id : beUniqueIdList) { - def resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/async_copy_into/async_load.groovy b/regression-test/suites/cloud_p0/multi_cluster/async_copy_into/async_load.groovy index 0e346d0389af2b..210a8abfde7d22 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/async_copy_into/async_load.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/async_copy_into/async_load.groovy @@ -44,7 +44,7 @@ suite("async_load") { sleep(1000) for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/copy_into/sync_laod.groovy b/regression-test/suites/cloud_p0/multi_cluster/copy_into/sync_laod.groovy index 72c84017185ba9..021dc480339776 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/copy_into/sync_laod.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/copy_into/sync_laod.groovy @@ -44,7 +44,7 @@ suite("sync_load") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/default_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/default_cluster.groovy index 7580ca13a8bdeb..297db0009a18c5 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/default_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/default_cluster.groovy @@ -43,7 +43,7 @@ suite("default_cluster") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/multi_cluster_s3_load/load.groovy b/regression-test/suites/cloud_p0/multi_cluster/multi_cluster_s3_load/load.groovy index 20108615679d37..d129769cd2fb7f 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/multi_cluster_s3_load/load.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/multi_cluster_s3_load/load.groovy @@ -51,7 +51,7 @@ suite("load") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/rename_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/rename_cluster.groovy index 95ad112733f051..d82491a35d9ff2 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/rename_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/rename_cluster.groovy @@ -43,7 +43,7 @@ suite("test_rename_cluster") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/routine_load/test_routine_load.groovy b/regression-test/suites/cloud_p0/multi_cluster/routine_load/test_routine_load.groovy index 08d51883ccb052..b24fe9c3395c7c 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/routine_load/test_routine_load.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/routine_load/test_routine_load.groovy @@ -51,7 +51,7 @@ suite("test_routine_load") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_drop_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_drop_cluster.groovy index 378c22e7f50e07..8ba613936841b7 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_drop_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_drop_cluster.groovy @@ -45,7 +45,7 @@ suite("test_materialized_with_drop_cluster") { logger.info("beUniqueIdList:{}", beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_readd_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_readd_cluster.groovy index 76ed1c328a467c..03df825431d3fd 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_readd_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_materialized_view_with_readd_cluster.groovy @@ -44,7 +44,7 @@ suite("test_materialized_view_with_readd_cluster") { logger.info("beUniqueIdList:{}", beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_drop_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_drop_cluster.groovy index 1633b8b57c1026..8b03c97df9b2c7 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_drop_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_drop_cluster.groovy @@ -44,7 +44,7 @@ suite("test_rollup_with_drop_cluster") { logger.info("beUniqueIdList:{}", beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_readd_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_readd_cluster.groovy index a8eb4d82e6d4dc..3e1857e573350e 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_readd_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_rollup_with_readd_cluster.groovy @@ -44,7 +44,7 @@ suite("test_rollup_with_readd_cluster") { logger.info("beUniqueIdList:{}", beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_drop_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_drop_cluster.groovy index fe156bbe03e821..9a37f40a110567 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_drop_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_drop_cluster.groovy @@ -44,7 +44,7 @@ suite("test_schema_change_with_drop_cluster") { logger.info("beUniqueIdList:{}", beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_readd_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_readd_cluster.groovy index 924c3717a558fd..0c9391b09d5c25 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_readd_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/schema_change/test_schema_change_with_readd_cluster.groovy @@ -44,7 +44,7 @@ suite("test_schema_change_with_readd_cluster") { logger.info("beUniqueIdList:{}", beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load.groovy b/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load.groovy index 6e702b96c29485..b0372599e62b1a 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load.groovy @@ -44,7 +44,7 @@ suite("stream_load") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_2pc.groovy b/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_2pc.groovy index 6bda5ac46c572e..7146751e571d3b 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_2pc.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_2pc.groovy @@ -40,7 +40,7 @@ suite("stream_load_2pc") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_lb.groovy b/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_lb.groovy index 4fe90c76264d9a..5ce8d35b295647 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_lb.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/stream_load/stream_load_lb.groovy @@ -43,7 +43,7 @@ suite("stream_load_lb") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/table_rebalance.groovy b/regression-test/suites/cloud_p0/multi_cluster/table_rebalance.groovy index 667f923531972a..0b33822df118c8 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/table_rebalance.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/table_rebalance.groovy @@ -44,7 +44,7 @@ suite("table_rebalance") { def testFunc = { -> for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); @@ -153,18 +153,18 @@ suite("table_rebalance") { } - def balance_tablet_percent_per_run = 0.5 + def cloud_balance_tablet_percent_per_run = 0.5 for (def enable_global_balance in [false, true]) { for (def preheating_enabled in [false, true]) { - log.info("test table rebalance with balance_tablet_percent_per_run=${balance_tablet_percent_per_run}, " + log.info("test table rebalance with cloud_balance_tablet_percent_per_run=${cloud_balance_tablet_percent_per_run}, " + "enable_global_balance=${enable_global_balance}, preheating_enabled=${preheating_enabled}") try { - setFeConfig('balance_tablet_percent_per_run', balance_tablet_percent_per_run) + setFeConfig('cloud_balance_tablet_percent_per_run', cloud_balance_tablet_percent_per_run) setFeConfig('enable_global_balance', enable_global_balance) setFeConfig('preheating_enabled', preheating_enabled) testFunc.call() } finally { - setFeConfig('balance_tablet_percent_per_run', 0.05) + setFeConfig('cloud_balance_tablet_percent_per_run', 0.05) setFeConfig('enable_global_balance', true) setFeConfig('preheating_enabled', true) } diff --git a/regression-test/suites/cloud_p0/multi_cluster/test_apsaradb_internal_stage.groovy b/regression-test/suites/cloud_p0/multi_cluster/test_apsaradb_internal_stage.groovy index e5ed1a752a9f73..18f05222835002 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/test_apsaradb_internal_stage.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/test_apsaradb_internal_stage.groovy @@ -48,7 +48,7 @@ suite("test_apsarad_internal_stage_copy_into") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/test_cloud_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/test_cloud_cluster.groovy index 43f70aed242c4a..187aef798493d4 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/test_cloud_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/test_cloud_cluster.groovy @@ -44,7 +44,7 @@ suite("test_cloud_cluster") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/test_drop_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/test_drop_cluster.groovy index f23108881546a9..922b5ba12ca470 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/test_drop_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/test_drop_cluster.groovy @@ -43,7 +43,7 @@ suite("test_drop_cluster") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/test_group_commit_multi_cluster.groovy b/regression-test/suites/cloud_p0/multi_cluster/test_group_commit_multi_cluster.groovy index 1d8b936d70ae69..044adb52128aba 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/test_group_commit_multi_cluster.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/test_group_commit_multi_cluster.groovy @@ -43,7 +43,7 @@ suite("test_group_commit_multi_cluster") { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id); diff --git a/regression-test/suites/cloud_p0/multi_cluster/test_overdue_instance.groovy b/regression-test/suites/cloud_p0/multi_cluster/test_overdue_instance.groovy index 3a50afe0509b8a..f7c015efcb3859 100644 --- a/regression-test/suites/cloud_p0/multi_cluster/test_overdue_instance.groovy +++ b/regression-test/suites/cloud_p0/multi_cluster/test_overdue_instance.groovy @@ -85,7 +85,7 @@ suite('test_overdue') { println("the be unique id is " + beUniqueIdList); for (unique_id : beUniqueIdList) { - resp = get_cluster.call(unique_id); + def resp = get_cluster.call(unique_id) for (cluster : resp) { if (cluster.type == "COMPUTE") { drop_cluster.call(cluster.cluster_name, cluster.cluster_id);