Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test(dm): split other test cases and fix unstable test (#6703) #6717

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 33 additions & 2 deletions dm/tests/checkpoint_transaction/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,40 @@ function run() {
# check diff
check_sync_diff $WORK_DIR $cur/conf/diff_config.toml

<<<<<<< HEAD
=======
# test ungraceful stop, worker will not wait transaction finish
run_sql_file $cur/data/db1.increment1.sql $MYSQL_HOST1 $MYSQL_PORT1 $MYSQL_PASSWORD1
sleep 2
# kill dm-master 1 to make worker lost keep alive while a transaction is not finished
echo "kill dm-master1"
kill_dm_master
check_master_port_offline 1
sleep 1 # wait worker lost keep alive ttl is 1 second

# check dm-worker will exit quickly without waiting for the transaction to finish
check_worker_ungraceful_stop_with_retry

# test data in tidb less than source
dataCountSource=$(mysql -uroot -h$MYSQL_HOST1 -P$MYSQL_PORT1 -p$MYSQL_PASSWORD1 -se "select count(1) from checkpoint_transaction.t1")
dataCountInTiDB=$(mysql -uroot -h127.0.0.1 -P4000 -se "select count(1) from checkpoint_transaction.t1")
echo "after ungraceful exit data in source count: $dataCountSource data in tidb count: $dataCountInTiDB"
if [ "$dataCountInTiDB" -lt "$dataCountSource" ]; then
echo "ungraceful stop test success"
else
echo "ungraceful stop test failed"
exit 1
fi

# start dm-master again task will be resume, and data will be synced
run_dm_master $WORK_DIR/master $MASTER_PORT $cur/conf/dm-master.toml
check_rpc_alive $cur/../bin/check_master_online 127.0.0.1:$MASTER_PORT
sleep 3
check_sync_diff $WORK_DIR $cur/conf/diff_config.toml
>>>>>>> 0492d3f50 (test(dm): split other test cases and fix unstable test (#6703))
run_sql_file $cur/data/db1.increment1.sql $MYSQL_HOST1 $MYSQL_PORT1 $MYSQL_PASSWORD1
# wait transaction start
check_log_contain_with_retry "receive dml job" $WORK_DIR/worker1/log/dm-worker.log
check_log_contain_with_retry "\[32,30,null\]" $WORK_DIR/worker1/log/dm-worker.log
echo "pause task and check status"
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"pause-task test" \
Expand All @@ -56,7 +87,7 @@ function run() {

run_sql_file $cur/data/db1.increment2.sql $MYSQL_HOST1 $MYSQL_PORT1 $MYSQL_PASSWORD1
# wait transaction start
check_log_contain_with_retry "receive dml job" $WORK_DIR/worker1/log/dm-worker.log
check_log_contain_with_retry "\[62,null,30\]" $WORK_DIR/worker1/log/dm-worker.log
echo "stop task"
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"stop-task test" \
Expand Down
3 changes: 3 additions & 0 deletions dm/tests/others_integration_1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ drop_column_with_index
gtid
only_dml
adjust_gtid
<<<<<<< HEAD
checkpoint_transaction
lightning_mode
downstream_diff_index
downstream_index_order
=======
>>>>>>> 0492d3f50 (test(dm): split other test cases and fix unstable test (#6703))
3 changes: 3 additions & 0 deletions dm/tests/others_integration_2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ sql_mode
http_proxies
openapi
duplicate_event
<<<<<<< HEAD
tracker_ignored_ddl
=======
>>>>>>> 0492d3f50 (test(dm): split other test cases and fix unstable test (#6703))
11 changes: 11 additions & 0 deletions dm/tests/others_integration_3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
checkpoint_transaction
lightning_mode
slow_relay_writer
sync_collation
s3_dumpling_lighting
async_checkpoint_flush
tracker_ignored_ddl
extend_column
shardddl_optimistic
gbk
new_collation_off