From 7ea359f9873d030d49212053137c36ea5147155c Mon Sep 17 00:00:00 2001 From: zhangdong <493738387@qq.com> Date: Mon, 23 Sep 2024 14:43:54 +0800 Subject: [PATCH 1/3] 1 --- .../test_iot_auto_detect_concurrent.groovy | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy b/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy index e796edfe5bb1d2..0c290d7e8cede5 100644 --- a/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy +++ b/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy @@ -26,6 +26,7 @@ suite("test_iot_auto_detect_concurrent") { sql new File("""${context.file.parent}/ddl/test_iot_auto_detect_concurrent.sql""").text def success_status = true + def err_msg = "" def load_data = { range, offset, expect_success -> try { sql " use test_iot_auto_detect_concurrent; " @@ -37,6 +38,7 @@ suite("test_iot_auto_detect_concurrent") { success_status = false log.info("fails one") } + err_msg = e.getMessage() log.info("successfully catch the failed insert") return } @@ -98,10 +100,9 @@ suite("test_iot_auto_detect_concurrent") { thread6.join() thread7.join() // suppose result: Success to overwrite with a multiple of ten values - assertTrue(success_status) - qt_sql3 " select count(k0) from test_concurrent_write; " - qt_sql4 " select count(distinct k0) from test_concurrent_write; " - + if (!success_status) { + assertTrue(e.getMessage().contains('same table')) + } /// with drop partition concurrently success_status = true From 8f5c92db6e20ba1a586bc9b8cdcd541b08eb022c Mon Sep 17 00:00:00 2001 From: zhangdong <493738387@qq.com> Date: Mon, 23 Sep 2024 14:48:26 +0800 Subject: [PATCH 2/3] 1 --- .../insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy b/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy index 0c290d7e8cede5..46453cdb246599 100644 --- a/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy +++ b/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy @@ -101,7 +101,8 @@ suite("test_iot_auto_detect_concurrent") { thread7.join() // suppose result: Success to overwrite with a multiple of ten values if (!success_status) { - assertTrue(e.getMessage().contains('same table')) + // Not allowed running Insert Overwrite on same table + assertTrue(err_msg.contains('same table')) } /// with drop partition concurrently From 0ca223f79dbd6a5f6699a578547b56915d094951 Mon Sep 17 00:00:00 2001 From: zhangdong <493738387@qq.com> Date: Mon, 23 Sep 2024 14:52:14 +0800 Subject: [PATCH 3/3] 1 --- .../test_iot_auto_detect_concurrent.groovy | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy b/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy index 46453cdb246599..0ce026fb99b184 100644 --- a/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy +++ b/regression-test/suites/insert_overwrite_p1/test_iot_auto_detect_concurrent.groovy @@ -103,6 +103,10 @@ suite("test_iot_auto_detect_concurrent") { if (!success_status) { // Not allowed running Insert Overwrite on same table assertTrue(err_msg.contains('same table')) + } else { + // The execution was fast, resulting in no concurrent execution + qt_sql3 " select count(k0) from test_concurrent_write; " + qt_sql4 " select count(distinct k0) from test_concurrent_write; " } /// with drop partition concurrently