TsukiokaKogane commented on code in PR #67173: URL: https://github.com/apache/doris/pull/67173#discussion_r3868264969
########## regression-test/suites/table_stream_p0/test_olap_table_stream_schema_sync.groovy: ########## @@ -0,0 +1,129 @@ +// 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. + +// The stream schema is generated dynamically from the base table, so a base table +// schema change (ADD/DROP COLUMN) must be reflected by the stream automatically. +suite("test_olap_table_stream_schema_sync", "nonConcurrent") { + if (isCloudMode()) { + return + } + sql "DROP DATABASE IF EXISTS test_olap_table_stream_schema_sync_db" + sql "CREATE DATABASE test_olap_table_stream_schema_sync_db" + sql "USE test_olap_table_stream_schema_sync_db" + + def baseTable = "schema_sync_base" + def streamName = "schema_sync_stream" + + def delta_time = 1000 + def useTime = 0 + def wait_for_latest_op_on_table_finish = { tableName, opTimeout -> + for (int t = delta_time; t <= opTimeout; t += delta_time) { + def alter_res = sql """SHOW ALTER TABLE COLUMN WHERE TableName = "${tableName}" ORDER BY CreateTime DESC LIMIT 1;""" + alter_res = alter_res.toString() + if (alter_res.contains("FINISHED")) { + sleep(3000) // wait change table state to normal + logger.info(tableName + " latest alter job finished, detail: " + alter_res) + break + } + useTime = t + sleep(delta_time) + } + assertTrue(useTime <= opTimeout, "wait_for_latest_op_on_table_finish timeout") Review Comment: false positive -- 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]
