From e6ca256257fbe6e744892841537a16eb84469116 Mon Sep 17 00:00:00 2001 From: lance6716 Date: Fri, 30 Oct 2020 14:10:16 +0800 Subject: [PATCH] test: relax error message for more tidb version (#1251) (#1252) --- tests/all_mode/run.sh | 4 +++- tests/import_v10x/run.sh | 3 ++- tests/shardddl1/run.sh | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/all_mode/run.sh b/tests/all_mode/run.sh index 426c637941..627609b289 100755 --- a/tests/all_mode/run.sh +++ b/tests/all_mode/run.sh @@ -33,10 +33,12 @@ function test_session_config(){ sed -i "s/name: test/name: $ILLEGAL_CHAR_NAME/g" $WORK_DIR/dm-task.yaml # error config + # there should be a error message like "Incorrect argument type to variable 'tidb_retry_limit'" + # but different TiDB version output different message. so we only roughly match here sed -i 's/tidb_retry_limit: "10"/tidb_retry_limit: "fjs"/g' $WORK_DIR/dm-task.yaml run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \ "start-task $WORK_DIR/dm-task.yaml --remove-meta" \ - "Incorrect argument type to variable 'tidb_retry_limit'" 1 + "tidb_retry_limit" 1 sed -i 's/tidb_retry_limit: "fjs"/tidb_retry_limit: "10"/g' $WORK_DIR/dm-task.yaml dmctl_start_task "$WORK_DIR/dm-task.yaml" "--remove-meta" diff --git a/tests/import_v10x/run.sh b/tests/import_v10x/run.sh index ff0d1bd76f..3146bfafe2 100644 --- a/tests/import_v10x/run.sh +++ b/tests/import_v10x/run.sh @@ -82,7 +82,8 @@ function run() { run_sql "show create table \`dm_meta\`.\`test_syncer_checkpoint\`" $TIDB_PORT $TIDB_PASSWORD check_contains "\`exit_safe_binlog_name\` varchar(128) DEFAULT ''" - check_contains "\`exit_safe_binlog_pos\` int(10) unsigned DEFAULT '0'" + # different TiDB will output DEFAULT 0 or DEFAULT '0' + check_contains "\`exit_safe_binlog_pos\` int(10) unsigned DEFAULT " check_contains "\`exit_safe_binlog_gtid\` text DEFAULT NULL" run_sql_file $cur/data/db1.increment.sql $MYSQL_HOST1 $MYSQL_PORT1 $MYSQL_PASSWORD1 diff --git a/tests/shardddl1/run.sh b/tests/shardddl1/run.sh index 8d69425fb0..2cb6536538 100644 --- a/tests/shardddl1/run.sh +++ b/tests/shardddl1/run.sh @@ -312,9 +312,11 @@ function DM_027_CASE() { run_sql_source1 "insert into ${shardddl1}.${tb2} values (4)" run_sql_source1 "insert into ${shardddl1}.${tb3} values (5,6)" # we now haven't checked table struct when create sharding table + # there should be a error message like "Unknown column 'val' in 'field list'", "unknown column val" + # but different TiDB version output different message. so we only roughly match here run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \ "query-status test" \ - "Unknown column 'val' in 'field list'" 1 + "nknown column" 1 # ignore case for first letter } function DM_027() {