From cf8cc2e27dae083e4a28444ed218aa78f87f16ad Mon Sep 17 00:00:00 2001 From: Ruihao Chen Date: Wed, 12 Feb 2025 11:08:44 +0800 Subject: [PATCH 1/6] enable integration tests for sync_diff_inspector --- Makefile | 11 +++++++++++ sync_diff_inspector/tests/README.md | 2 +- sync_diff_inspector/tests/_utils/check_contains | 2 +- sync_diff_inspector/tests/_utils/check_contains_count | 2 +- sync_diff_inspector/tests/_utils/check_contains_regex | 2 +- sync_diff_inspector/tests/run.sh | 2 +- .../sync_diff_inspector/checkpoint/config_base.toml | 2 +- .../checkpoint/config_base_continous.toml | 2 +- .../checkpoint/config_base_rand.toml | 2 +- .../tests/sync_diff_inspector/checkpoint/run.sh | 2 +- .../tests/sync_diff_inspector/config_base_mysql.toml | 2 +- .../tests/sync_diff_inspector/config_base_tidb.toml | 2 +- .../tests/sync_diff_inspector/expression/config.toml | 2 +- .../tests/sync_diff_inspector/expression/run.sh | 4 ++-- .../tests/sync_diff_inspector/json/config_base.toml | 2 +- .../tests/sync_diff_inspector/json/run.sh | 2 +- sync_diff_inspector/tests/sync_diff_inspector/run.sh | 2 +- .../tests/sync_diff_inspector/shard/config_base.toml | 2 +- .../sync_diff_inspector/shard/config_router_1.toml | 2 +- .../sync_diff_inspector/shard/config_router_2.toml | 2 +- .../sync_diff_inspector/shard/config_router_3.toml | 2 +- .../sync_diff_inspector/shard/config_router_4.toml | 2 +- .../sync_diff_inspector/shard/config_router_5.toml | 2 +- .../tests/sync_diff_inspector/shard/run.sh | 2 +- .../sync_diff_inspector/snapshot/config_base.toml | 2 +- .../tests/sync_diff_inspector/snapshot/run.sh | 4 ++-- .../sync_diff_inspector/table_config/config.toml | 2 +- .../tests/sync_diff_inspector/table_config/run.sh | 4 ++-- .../sync_diff_inspector/table_skip/config_base.toml | 2 +- .../sync_diff_inspector/table_skip/config_router.toml | 2 +- .../tests/sync_diff_inspector/table_skip/run.sh | 2 +- .../tests/sync_diff_inspector/time_zone/config.toml | 2 +- .../tests/sync_diff_inspector/time_zone/run.sh | 4 ++-- .../tests/sync_diff_inspector/tls/config.toml | 2 +- .../tests/sync_diff_inspector/tls/run.sh | 2 +- 35 files changed, 49 insertions(+), 38 deletions(-) diff --git a/Makefile b/Makefile index b8f93fe04bd..e57702a4174 100644 --- a/Makefile +++ b/Makefile @@ -388,6 +388,17 @@ clean: sync-diff-inspector: $(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/sync_diff_inspector ./sync_diff_inspector +sync-diff-inspector-integration-test: failpoint-enable sync_diff_inspector failpoint-disable + @which bin/tidb-server + @which bin/tikv-server + @which bin/pd-server + @which bin/sync_diff_inspector + @which bin/dumpling + @which bin/loader + @which bin/importer + cd sync_diff_inspector && ln -sf ../bin . + cd sync_diff_inspector && ./tests/run.sh + dm: dm-master dm-worker dmctl dm-syncer dm-master: diff --git a/sync_diff_inspector/tests/README.md b/sync_diff_inspector/tests/README.md index 443b78dd7e8..efbb53fe911 100644 --- a/sync_diff_inspector/tests/README.md +++ b/sync_diff_inspector/tests/README.md @@ -21,7 +21,7 @@ This folder contains all tests which relies on external service such as TiDB. 3. The user executing the tests must have permission to create the folder - `/tmp/tidb_tools_test`. All test artifacts will be written into this folder. + `/tmp/sync_diff_inspector_test`. All test artifacts will be written into this folder. ## Running diff --git a/sync_diff_inspector/tests/_utils/check_contains b/sync_diff_inspector/tests/_utils/check_contains index 651ee15fb5a..4bf3cb77b7a 100755 --- a/sync_diff_inspector/tests/_utils/check_contains +++ b/sync_diff_inspector/tests/_utils/check_contains @@ -4,7 +4,7 @@ # argument 2 is the filename set -eu -OUT_DIR=/tmp/tidb_tools_test +OUT_DIR=/tmp/sync_diff_inspector_test if ! grep -Fq "$1" "$2"; then echo "TEST FAILED: '$2' DOES NOT CONTAIN '$1'" diff --git a/sync_diff_inspector/tests/_utils/check_contains_count b/sync_diff_inspector/tests/_utils/check_contains_count index 79dd3c79e3b..9dcf3f46c95 100755 --- a/sync_diff_inspector/tests/_utils/check_contains_count +++ b/sync_diff_inspector/tests/_utils/check_contains_count @@ -5,7 +5,7 @@ # argument 3 is the match count set -eu -OUT_DIR=/tmp/tidb_tools_test +OUT_DIR=/tmp/sync_diff_inspector_test count=$(grep -F "$1" "$2" | wc -l) diff --git a/sync_diff_inspector/tests/_utils/check_contains_regex b/sync_diff_inspector/tests/_utils/check_contains_regex index c8d780a6cc5..f1ac3f5adea 100755 --- a/sync_diff_inspector/tests/_utils/check_contains_regex +++ b/sync_diff_inspector/tests/_utils/check_contains_regex @@ -4,7 +4,7 @@ # argument 2 is the filename set -eu -OUT_DIR=/tmp/tidb_tools_test +OUT_DIR=/tmp/sync_diff_inspector_test if ! grep -q "$1" "$2"; then echo "TEST FAILED: '$2' DOES NOT CONTAIN '$1'" diff --git a/sync_diff_inspector/tests/run.sh b/sync_diff_inspector/tests/run.sh index f5f54536b88..c98c7e75421 100755 --- a/sync_diff_inspector/tests/run.sh +++ b/sync_diff_inspector/tests/run.sh @@ -2,7 +2,7 @@ set -eu -OUT_DIR=/tmp/tidb_tools_test +OUT_DIR=/tmp/sync_diff_inspector_test # assign default value to mysql config if [[ -z ${MYSQL_HOST+x} ]]; then diff --git a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base.toml b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base.toml index 37629b414fa..671dba46490 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base.toml @@ -40,7 +40,7 @@ chunk-size = 10 # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_continous.toml b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_continous.toml index b83552c0cd7..2d897f52bab 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_continous.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_continous.toml @@ -42,7 +42,7 @@ chunk-size = 50 # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_rand.toml b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_rand.toml index 50d15de73b7..d2e3248f65f 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_rand.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/config_base_rand.toml @@ -41,7 +41,7 @@ chunk-size = 500 # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh index ac2a1d53016..a4a40b30bb4 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh @@ -4,7 +4,7 @@ set -ex cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output rm -rf $OUT_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/config_base_mysql.toml b/sync_diff_inspector/tests/sync_diff_inspector/config_base_mysql.toml index f56695ba72a..591a46d8142 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/config_base_mysql.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/config_base_mysql.toml @@ -36,7 +36,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/config_base_tidb.toml b/sync_diff_inspector/tests/sync_diff_inspector/config_base_tidb.toml index 726db6c1e00..0f04629d565 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/config_base_tidb.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/config_base_tidb.toml @@ -37,7 +37,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["tidb1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/expression/config.toml b/sync_diff_inspector/tests/sync_diff_inspector/expression/config.toml index 782ffa97884..1b6b90f6f25 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/expression/config.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/expression/config.toml @@ -36,7 +36,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["tidb1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/expression/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/expression/run.sh index 77336b7461a..d9da2dc1ab6 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/expression/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/expression/run.sh @@ -3,8 +3,8 @@ set -ex cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output -FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output +FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql rm -rf $OUT_DIR rm -rf $FIX_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/json/config_base.toml b/sync_diff_inspector/tests/sync_diff_inspector/json/config_base.toml index fc0d8f8e9a9..8698b7fc6c8 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/json/config_base.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/json/config_base.toml @@ -36,7 +36,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/json/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/json/run.sh index 16312c44a9a..40982463cdb 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/json/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/json/run.sh @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output rm -rf $OUT_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/run.sh index cc82282f31b..634de3e2921 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/run.sh @@ -7,7 +7,7 @@ cd "$(dirname "$0")" # check mysql status check_db_status "${MYSQL_HOST}" "${MYSQL_PORT}" mysql "." -BASE_DIR=/tmp/tidb_tools_test/sync_diff_inspector +BASE_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector OUT_DIR=$BASE_DIR/output mkdir -p $OUT_DIR || true diff --git a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_base.toml b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_base.toml index 9c34352c958..69a6230e58b 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_base.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_base.toml @@ -45,7 +45,7 @@ target-table = "test" # 目标表名 # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_1.toml b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_1.toml index 953fd67cd0a..56fea038c2f 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_1.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_1.toml @@ -45,7 +45,7 @@ target-table = "tbl" # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_2.toml b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_2.toml index a36d0ab3727..9e27ec1ef42 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_2.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_2.toml @@ -43,7 +43,7 @@ target-schema = "router_test_1" # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_3.toml b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_3.toml index 055afef9997..196fc213372 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_3.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_3.toml @@ -45,7 +45,7 @@ target-table = "tbl" # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_4.toml b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_4.toml index 3b75fc35312..9af16a153e3 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_4.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_4.toml @@ -39,7 +39,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_5.toml b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_5.toml index 8ef05c96bc5..06e3ddcc418 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_5.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/shard/config_router_5.toml @@ -45,7 +45,7 @@ target-table = "tbl" # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/shard/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/shard/run.sh index 729059c5cc7..8795632b1e8 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/shard/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/shard/run.sh @@ -4,7 +4,7 @@ set -e cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output rm -rf $OUT_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/snapshot/config_base.toml b/sync_diff_inspector/tests/sync_diff_inspector/snapshot/config_base.toml index a8921fb6ad4..0c871c05f0c 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/snapshot/config_base.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/snapshot/config_base.toml @@ -37,7 +37,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["tidb1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/snapshot/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/snapshot/run.sh index c34c78b81ec..e0834ec9d44 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/snapshot/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/snapshot/run.sh @@ -4,8 +4,8 @@ set -e cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output -FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output +FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql rm -rf $OUT_DIR rm -rf $FIX_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/table_config/config.toml b/sync_diff_inspector/tests/sync_diff_inspector/table_config/config.toml index 5f5bc45a182..c881e6de0d8 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/table_config/config.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/table_config/config.toml @@ -37,7 +37,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["tidb1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/table_config/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/table_config/run.sh index fa5b97a702d..ffa4aacc743 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/table_config/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/table_config/run.sh @@ -4,8 +4,8 @@ set -e cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output -FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output +FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql rm -rf $OUT_DIR rm -rf $FIX_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_base.toml b/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_base.toml index ba341007394..244638291a9 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_base.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_base.toml @@ -39,7 +39,7 @@ skip-non-existing-table = true # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_router.toml b/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_router.toml index 2fa4ededf3e..736116ae286 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_router.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/table_skip/config_router.toml @@ -51,7 +51,7 @@ target-table = "t5" ######################### Task config ######################### [task] - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["mysql1", "mysql2"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/table_skip/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/table_skip/run.sh index 4ee4e3b98b1..99edc8e64f3 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/table_skip/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/table_skip/run.sh @@ -4,7 +4,7 @@ set -ex cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output rm -rf $OUT_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/time_zone/config.toml b/sync_diff_inspector/tests/sync_diff_inspector/time_zone/config.toml index 4f3f813eef1..60ad69c75f8 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/time_zone/config.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/time_zone/config.toml @@ -36,7 +36,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["tidb1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/time_zone/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/time_zone/run.sh index 05b015ec8f4..ae9367c3f4d 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/time_zone/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/time_zone/run.sh @@ -3,8 +3,8 @@ set -ex cd "$(dirname "$0")" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output -FIX_DIR=/tmp/tidb_tools_test/sync_diff_inspector/fixsql +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output +FIX_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/fixsql rm -rf $OUT_DIR rm -rf $FIX_DIR mkdir -p $OUT_DIR diff --git a/sync_diff_inspector/tests/sync_diff_inspector/tls/config.toml b/sync_diff_inspector/tests/sync_diff_inspector/tls/config.toml index 323134207ef..4995f15f272 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/tls/config.toml +++ b/sync_diff_inspector/tests/sync_diff_inspector/tls/config.toml @@ -41,7 +41,7 @@ check-struct-only = false # 2 log: sync-diff.log # 3 summary: summary.txt # 4 checkpoint: a dir - output-dir = "/tmp/tidb_tools_test/sync_diff_inspector/output" + output-dir = "/tmp/sync_diff_inspector_test/sync_diff_inspector/output" source-instances = ["tidb1"] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/tls/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/tls/run.sh index cfec9d28126..c9217cb17fb 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/tls/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/tls/run.sh @@ -8,7 +8,7 @@ CONF_PATH=$(cd ../../conf && pwd) CA_PATH="$CONF_PATH/root.crt" CERT_PATH="$CONF_PATH/client.crt" KEY_PATH="$CONF_PATH/client.key" -OUT_DIR=/tmp/tidb_tools_test/sync_diff_inspector/output +OUT_DIR=/tmp/sync_diff_inspector_test/sync_diff_inspector/output rm -rf $OUT_DIR mkdir -p $OUT_DIR From 8ba83249a149d5297b0e35783c492dd6cb995ad0 Mon Sep 17 00:00:00 2001 From: Ruihao Chen Date: Wed, 12 Feb 2025 11:26:35 +0800 Subject: [PATCH 2/6] change to snake case --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index e57702a4174..ab0c37ede01 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ mysql_docker_integration_test mysql_docker_integration_test_with_build \ build_mysql_integration_test_images clean_integration_test_images \ dm dm-master dm-worker dmctl dm-syncer dm_coverage \ - sync-diff-inspector \ + sync_diff_inspector \ engine tiflow tiflow-demo tiflow-chaos-case engine_image help \ format-makefiles check-makefiles oauth2_server prepare_test_binaries @@ -226,7 +226,7 @@ check_third_party_binary: @which bin/minio @which bin/bin/schema-registry-start -integration_test_build: check_failpoint_ctl storage_consumer kafka_consumer pulsar_consumer oauth2_server sync-diff-inspector +integration_test_build: check_failpoint_ctl storage_consumer kafka_consumer pulsar_consumer oauth2_server sync_diff_inspector $(FAILPOINT_ENABLE) $(GOTEST) -ldflags '$(LDFLAGS)' -c -cover -covermode=atomic \ -coverpkg=github.com/pingcap/tiflow/... \ @@ -253,7 +253,7 @@ build_mysql_integration_test_images: ## Build MySQL integration test images with build_mysql_integration_test_images: clean_integration_test_containers docker-compose -f $(TICDC_DOCKER_DEPLOYMENTS_DIR)/docker-compose-mysql-integration.yml build --no-cache -integration_test_kafka: check_third_party_binary sync-diff-inspector +integration_test_kafka: check_third_party_binary sync_diff_inspector tests/integration_tests/run.sh kafka "$(CASE)" "$(START_AT)" integration_test_storage: @@ -385,10 +385,10 @@ clean: rm -rf tools/bin rm -rf tools/include -sync-diff-inspector: +sync_diff_inspector: $(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/sync_diff_inspector ./sync_diff_inspector -sync-diff-inspector-integration-test: failpoint-enable sync_diff_inspector failpoint-disable +sync_diff_inspector-integration_test: failpoint-enable sync_diff_inspector failpoint-disable @which bin/tidb-server @which bin/tikv-server @which bin/pd-server @@ -457,7 +457,7 @@ dm_unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin/goc tools/bin/gocov convert "$(DM_TEST_DIR)/cov.unit_test.out" | tools/bin/gocov-xml > dm-coverage.xml $(FAILPOINT_DISABLE) -dm_integration_test_build: check_failpoint_ctl sync-diff-inspector +dm_integration_test_build: check_failpoint_ctl sync_diff_inspector $(FAILPOINT_ENABLE) $(GOTEST) -ldflags '$(LDFLAGS)' -c -cover -covermode=atomic \ -coverpkg=github.com/pingcap/tiflow/dm/... \ @@ -509,7 +509,7 @@ install_test_python_dep: @echo "install python requirments for test" pip install --user -q -r ./dm/tests/requirements.txt -check_third_party_binary_for_dm : sync-diff-inspector +check_third_party_binary_for_dm : sync_diff_inspector @which bin/tidb-server @which mysql @which bin/minio @@ -567,7 +567,7 @@ tiflow-chaos-case: engine_unit_test: check_failpoint_ctl $(call run_engine_unit_test,$(ENGINE_PACKAGES)) -engine_integration_test: check_third_party_binary_for_engine sync-diff-inspector +engine_integration_test: check_third_party_binary_for_engine sync_diff_inspector mkdir -p /tmp/tiflow_engine_test || true ./engine/test/integration_tests/run.sh "$(CASE)" "$(START_AT)" 2>&1 | tee /tmp/tiflow_engine_test/engine_it.log ./engine/test/utils/check_log.sh From 943971051f70a659b06dc44239777b811dd609f4 Mon Sep 17 00:00:00 2001 From: Ruihao Chen Date: Mon, 17 Feb 2025 17:25:07 +0800 Subject: [PATCH 3/6] revert some changes --- Makefile | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index ab0c37ede01..aad6a20525c 100644 --- a/Makefile +++ b/Makefile @@ -6,7 +6,7 @@ mysql_docker_integration_test mysql_docker_integration_test_with_build \ build_mysql_integration_test_images clean_integration_test_images \ dm dm-master dm-worker dmctl dm-syncer dm_coverage \ - sync_diff_inspector \ + sync-diff-inspector \ engine tiflow tiflow-demo tiflow-chaos-case engine_image help \ format-makefiles check-makefiles oauth2_server prepare_test_binaries @@ -226,7 +226,7 @@ check_third_party_binary: @which bin/minio @which bin/bin/schema-registry-start -integration_test_build: check_failpoint_ctl storage_consumer kafka_consumer pulsar_consumer oauth2_server sync_diff_inspector +integration_test_build: check_failpoint_ctl storage_consumer kafka_consumer pulsar_consumer oauth2_server sync-diff-inspector $(FAILPOINT_ENABLE) $(GOTEST) -ldflags '$(LDFLAGS)' -c -cover -covermode=atomic \ -coverpkg=github.com/pingcap/tiflow/... \ @@ -253,7 +253,7 @@ build_mysql_integration_test_images: ## Build MySQL integration test images with build_mysql_integration_test_images: clean_integration_test_containers docker-compose -f $(TICDC_DOCKER_DEPLOYMENTS_DIR)/docker-compose-mysql-integration.yml build --no-cache -integration_test_kafka: check_third_party_binary sync_diff_inspector +integration_test_kafka: check_third_party_binary sync-diff-inspector tests/integration_tests/run.sh kafka "$(CASE)" "$(START_AT)" integration_test_storage: @@ -385,10 +385,10 @@ clean: rm -rf tools/bin rm -rf tools/include -sync_diff_inspector: +sync-diff-inspector: $(GOBUILD) -ldflags '$(LDFLAGS)' -o bin/sync_diff_inspector ./sync_diff_inspector -sync_diff_inspector-integration_test: failpoint-enable sync_diff_inspector failpoint-disable +sync-diff-inspector-integration_test: failpoint-enable sync-diff-inspector failpoint-disable @which bin/tidb-server @which bin/tikv-server @which bin/pd-server @@ -457,7 +457,7 @@ dm_unit_test_in_verify_ci: check_failpoint_ctl tools/bin/gotestsum tools/bin/goc tools/bin/gocov convert "$(DM_TEST_DIR)/cov.unit_test.out" | tools/bin/gocov-xml > dm-coverage.xml $(FAILPOINT_DISABLE) -dm_integration_test_build: check_failpoint_ctl sync_diff_inspector +dm_integration_test_build: check_failpoint_ctl sync-diff-inspector $(FAILPOINT_ENABLE) $(GOTEST) -ldflags '$(LDFLAGS)' -c -cover -covermode=atomic \ -coverpkg=github.com/pingcap/tiflow/dm/... \ @@ -509,7 +509,7 @@ install_test_python_dep: @echo "install python requirments for test" pip install --user -q -r ./dm/tests/requirements.txt -check_third_party_binary_for_dm : sync_diff_inspector +check_third_party_binary_for_dm : sync-diff-inspector @which bin/tidb-server @which mysql @which bin/minio @@ -567,7 +567,7 @@ tiflow-chaos-case: engine_unit_test: check_failpoint_ctl $(call run_engine_unit_test,$(ENGINE_PACKAGES)) -engine_integration_test: check_third_party_binary_for_engine sync_diff_inspector +engine_integration_test: check_third_party_binary_for_engine sync-diff-inspector mkdir -p /tmp/tiflow_engine_test || true ./engine/test/integration_tests/run.sh "$(CASE)" "$(START_AT)" 2>&1 | tee /tmp/tiflow_engine_test/engine_it.log ./engine/test/utils/check_log.sh From 2faeabfa2fcb17e8a42fa29f6518ff31048b95a0 Mon Sep 17 00:00:00 2001 From: Ruihao Chen Date: Thu, 20 Feb 2025 13:15:11 +0800 Subject: [PATCH 4/6] remove 'tidb-tools' from repo --- dm/pkg/shardddl/optimism/lock_test.go | 2 +- dm/syncer/validate_worker.go | 2 +- .../sync_diff_inspector/checkpoint/run.sh | 20 +++++++++---------- sync_diff_inspector/utils/table.go | 1 - 4 files changed, 12 insertions(+), 13 deletions(-) diff --git a/dm/pkg/shardddl/optimism/lock_test.go b/dm/pkg/shardddl/optimism/lock_test.go index ee93aa3c945..f952463d4cd 100644 --- a/dm/pkg/shardddl/optimism/lock_test.go +++ b/dm/pkg/shardddl/optimism/lock_test.go @@ -2738,7 +2738,7 @@ func (t *testLock) TestTrySyncForOneDDL(c *check.C) { c.Assert(schemaChanged, check.IsTrue) c.Assert(conflictStage, check.Equals, ConflictNone) - // check create partition, no changed since https://github.com/pingcap/tidb-tools/blob/d671b0840063bc2532941f02e02e12627402844c/pkg/schemacmp/table.go#L251 + // check create partition, no changed since https://github.com/pingcap/tidb/blob/42075e6ad60ba5d1f860ac845908f0c34ac28253/pkg/util/schemacmp/table.go#L256 schemaChanged, conflictStage = l.trySyncForOneDDL(source, schema, table1, t0, t1) c.Assert(schemaChanged, check.IsTrue) c.Assert(conflictStage, check.Equals, ConflictNone) diff --git a/dm/syncer/validate_worker.go b/dm/syncer/validate_worker.go index a32d8769001..42cdac119f1 100644 --- a/dm/syncer/validate_worker.go +++ b/dm/syncer/validate_worker.go @@ -476,7 +476,7 @@ type validateCompareContext struct { columns []*model.ColumnInfo } -// a simplified version of https://github.com/pingcap/tidb-tools/blob/d9fdfa2f9040aab3fab7cd11774a82226f467fe7/sync_diff_inspector/utils/utils.go#L487-L606 +// a simplified version of CompareData in sync_diff_inspector/utils/utils.go func (c *validateCompareContext) compareData(key string, sourceData, targetData []*sql.NullString) (bool, error) { for i, column := range c.columns { data1, data2 := sourceData[i], targetData[i] diff --git a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh index a4a40b30bb4..78116399867 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh @@ -14,8 +14,8 @@ sed "s/\"127.0.0.1\"#MYSQL_HOST/\"${MYSQL_HOST}\"/g" ./config_base.toml | sed "s echo "================test bucket checkpoint=================" echo "---------1. chunk is in the last of the bucket---------" -export GO_FAILPOINTS="github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/check-one-bucket=return();\ -github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/print-chunk-info=return();\ +export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/check-one-bucket=return();\ +github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return();\ main/wait-for-checkpoint=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output check_contains "check pass!!!" $OUT_DIR/sync_diff.log @@ -41,7 +41,7 @@ bucket_index_right=$(($(echo ${last_chunk_index_array[1]} | awk -F '-' '{print $ echo $bucket_index_right rm -f $OUT_DIR/sync_diff.log -export GO_FAILPOINTS="github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/print-chunk-info=return()" +export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output first_chunk_info=$(grep 'print-chunk-info' $OUT_DIR/sync_diff.log | awk -F 'lowerBounds=' '{print $2}' | sed 's/[]["]//g' | sort -n | awk 'NR==1') echo $first_chunk_info | awk -F '=' '{print $1}' >$OUT_DIR/first_chunk_bound @@ -55,9 +55,9 @@ check_contains_regex ".:${bucket_index_right}-.:0:." $OUT_DIR/first_chunk_index echo "--------2. chunk is in the middle of the bucket--------" rm -rf $OUT_DIR mkdir -p $OUT_DIR -export GO_FAILPOINTS="github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/check-one-bucket=return();\ -github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/ignore-last-n-chunk-in-bucket=return(1);\ -github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/print-chunk-info=return();\ +export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/check-one-bucket=return();\ +github.com/pingcap/tiflow/sync_diff_inspector/splitter/ignore-last-n-chunk-in-bucket=return(1);\ +github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return();\ main/wait-for-checkpoint=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output check_contains "check pass!!!" $OUT_DIR/sync_diff.log @@ -84,7 +84,7 @@ bucket_index_right=$(echo ${last_chunk_index_array[1]} | awk -F '-' '{print $2}' echo "${bucket_index_left}-${bucket_index_right}" rm -f $OUT_DIR/sync_diff.log -export GO_FAILPOINTS="github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/print-chunk-info=return()" +export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output first_chunk_info=$(grep 'print-chunk-info' $OUT_DIR/sync_diff.log | awk -F 'lowerBounds=' '{print $2}' | sed 's/[]["]//g' | sort -n | awk 'NR==1') echo $first_chunk_info | awk -F '=' '{print $1}' >$OUT_DIR/first_chunk_bound @@ -101,8 +101,8 @@ echo "================test random checkpoint=================" echo "--------------1. chunk is in the middle----------------" rm -rf $OUT_DIR mkdir -p $OUT_DIR -export GO_FAILPOINTS="github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/ignore-last-n-chunk-in-bucket=return(1);\ -github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/print-chunk-info=return();\ +export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/ignore-last-n-chunk-in-bucket=return(1);\ +github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return();\ main/wait-for-checkpoint=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output check_contains "check pass!!!" $OUT_DIR/sync_diff.log @@ -125,7 +125,7 @@ done [[ $((${last_chunk_index_array[2]} + 2)) -eq ${last_chunk_index_array[3]} ]] || exit 1 rm -f $OUT_DIR/sync_diff.log -export GO_FAILPOINTS="github.com/pingcap/tidb-tools/sync_diff_inspector/splitter/print-chunk-info=return()" +export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output first_chunk_info=$(grep 'print-chunk-info' $OUT_DIR/sync_diff.log | awk -F 'lowerBounds=' '{print $2}' | sed 's/[]["]//g' | sort -n | awk 'NR==1') echo $first_chunk_info | awk -F '=' '{print $1}' >$OUT_DIR/first_chunk_bound diff --git a/sync_diff_inspector/utils/table.go b/sync_diff_inspector/utils/table.go index c4709d697d6..0be08ca51ca 100644 --- a/sync_diff_inspector/utils/table.go +++ b/sync_diff_inspector/utils/table.go @@ -197,7 +197,6 @@ func GetTableInfo( // GetTableInfoBySQL gets the table info from SQL. // Here we didn't use dbutiltest.GetTableInfoBySQL because it use buildTableInfoWithCheck internally, // and the check itself may cause errors in some integration tests. -// See https://github.com/pingcap/tidb-tools/blob/37c2dad9218826a114e3389ac1209367715383ea/pkg/dbutil/table.go#L156-L162 func GetTableInfoBySQL(createTableSQL string, parser2 *parser.Parser) (table *model.TableInfo, err error) { stmt, err := parser2.ParseOneStmt(createTableSQL, "", "") if err != nil { From ae47d9deebba31e8282b694141b1fcb8e0bb7e82 Mon Sep 17 00:00:00 2001 From: Ruihao Chen Date: Thu, 20 Feb 2025 14:02:41 +0800 Subject: [PATCH 5/6] fix failpoint --- .../tests/sync_diff_inspector/checkpoint/run.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh index 78116399867..1382fe3e893 100644 --- a/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh +++ b/sync_diff_inspector/tests/sync_diff_inspector/checkpoint/run.sh @@ -16,7 +16,7 @@ echo "================test bucket checkpoint=================" echo "---------1. chunk is in the last of the bucket---------" export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/check-one-bucket=return();\ github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return();\ -main/wait-for-checkpoint=return()" +github.com/pingcap/tiflow/sync_diff_inspector/diff/wait-for-checkpoint=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output check_contains "check pass!!!" $OUT_DIR/sync_diff.log # Save the last chunk's info, @@ -58,7 +58,7 @@ mkdir -p $OUT_DIR export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/check-one-bucket=return();\ github.com/pingcap/tiflow/sync_diff_inspector/splitter/ignore-last-n-chunk-in-bucket=return(1);\ github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return();\ -main/wait-for-checkpoint=return()" +github.com/pingcap/tiflow/sync_diff_inspector/diff/wait-for-checkpoint=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output check_contains "check pass!!!" $OUT_DIR/sync_diff.log # Save the last chunk's info, @@ -103,7 +103,7 @@ rm -rf $OUT_DIR mkdir -p $OUT_DIR export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/splitter/ignore-last-n-chunk-in-bucket=return(1);\ github.com/pingcap/tiflow/sync_diff_inspector/splitter/print-chunk-info=return();\ -main/wait-for-checkpoint=return()" +github.com/pingcap/tiflow/sync_diff_inspector/diff/wait-for-checkpoint=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output check_contains "check pass!!!" $OUT_DIR/sync_diff.log # Save the last chunk's info, @@ -142,7 +142,7 @@ echo "================test checkpoint continous=================" # so data-check will be skipped mysql -uroot -h 127.0.0.1 -P 4000 -e "create table IF NOT EXISTS diff_test.ttt(a int, aa int, primary key(a), key(aa));" mysql -uroot -h ${MYSQL_HOST} -P ${MYSQL_PORT} -e "create table IF NOT EXISTS diff_test.ttt(a int, b int, primary key(a), key(b));" -export GO_FAILPOINTS="main/wait-for-checkpoint=return()" +export GO_FAILPOINTS="github.com/pingcap/tiflow/sync_diff_inspector/diff/wait-for-checkpoint=return()" sync_diff_inspector --config=./config.toml >$OUT_DIR/checkpoint_diff.output || true grep 'save checkpoint' $OUT_DIR/sync_diff.log | awk 'END {print}' >$OUT_DIR/checkpoint_info check_not_contains 'has-upper\":true' $OUT_DIR/checkpoint_info From edee108a84e6e41164fd6bf30fe7c2788a82b04a Mon Sep 17 00:00:00 2001 From: Ruihao Chen Date: Thu, 20 Feb 2025 14:22:59 +0800 Subject: [PATCH 6/6] fix lint --- dm/syncer/validate_worker.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dm/syncer/validate_worker.go b/dm/syncer/validate_worker.go index 42cdac119f1..3e7082085fb 100644 --- a/dm/syncer/validate_worker.go +++ b/dm/syncer/validate_worker.go @@ -476,7 +476,7 @@ type validateCompareContext struct { columns []*model.ColumnInfo } -// a simplified version of CompareData in sync_diff_inspector/utils/utils.go +// a simplified version of CompareData in https://github.com/pingcap/tiflow/blob/4c38b919659e8506c220d1be9b0fdd7baf609e33/sync_diff_inspector/utils/utils.go#L538 func (c *validateCompareContext) compareData(key string, sourceData, targetData []*sql.NullString) (bool, error) { for i, column := range c.columns { data1, data2 := sourceData[i], targetData[i]