github-actions[bot] commented on code in PR #68616:
URL: https://github.com/apache/doris/pull/68616#discussion_r4132547793


##########
regression-test/suites/job_p0/streaming_job/cdc/test_streaming_mysql_job_non_column_ddl.groovy:
##########
@@ -0,0 +1,125 @@
+// Licensed to the Apache Software Foundation (ASF) under one
+// or more contributor license agreements.  See the NOTICE file
+// distributed with this work for additional information
+// regarding copyright ownership.  The ASF licenses this file
+// to you under the Apache License, Version 2.0 (the
+// "License"); you may not use this file except in compliance
+// with the License.  You may obtain a copy of the License at
+//
+//   http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing,
+// software distributed under the License is distributed on an
+// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.  See the License for the
+// specific language governing permissions and limitations
+// under the License.
+
+import org.awaitility.Awaitility
+
+import static java.util.concurrent.TimeUnit.SECONDS
+
+suite("test_streaming_mysql_job_non_column_ddl", 
"p0,external,mysql,external_docker,external_docker_mysql,nondatalake") {
+    String enabled = context.config.otherConfigs.get("enableJdbcTest")
+    if (enabled == null || !enabled.equalsIgnoreCase("true")) {
+        return
+    }
+    String sourcePort = context.config.otherConfigs.get("mysql_57_port")
+    String externalEnvIp = context.config.otherConfigs.get("externalEnvIp")
+    String driverUrl = 
"https://${getS3BucketName()}.${getS3Endpoint()}/regression/jdbc_driver/mysql-connector-j-8.4.0.jar"
+    def currentDb = (sql "SELECT DATABASE()")[0][0]
+    def sourceSql = { String statement ->
+        connect("root", "123456", 
"jdbc:mysql://${externalEnvIp}:${sourcePort}") {
+            sql statement
+        }
+    }
+    def succeedCount = {
+        (sql """SELECT SucceedTaskCount FROM jobs("type"="insert")
+            WHERE Name='mysql_non_column_ddl'""")[0][0].toLong()
+    }
+    long committedCount = 0L
+    def waitForCommittedRow = { int id, String name ->
+        Awaitility.await().atMost(180, SECONDS).pollInterval(1, 
SECONDS).until({
+            def rows = sql "SELECT name FROM mysql_non_column_ddl WHERE 
id=${id}"
+            rows.size() == 1 && rows[0][0] == name
+        })
+        // The task that made the row visible must also commit its source 
offset.
+        Awaitility.await().atMost(180, SECONDS).pollInterval(1, 
SECONDS).until({
+            succeedCount() > committedCount

Review Comment:
   [P2] Wait for a task success after this row becomes visible. 
`committedCount` records the previous row's count, so an idle task can 
increment `SucceedTaskCount` before the next source INSERT. The next row may 
then become visible from stream-load flush before `commitOffset` has saved its 
schema and source offset, yet this predicate already passes and the suite 
issues another DDL. The new PostgreSQL and OceanBase non-column suites use the 
same pattern. Capture the count after observing the row and wait for a 
subsequent success, or verify the persisted offset directly.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to