Skip to content
This repository has been archived by the owner on Nov 24, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into fixHandleErrCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
lance6716 authored Aug 17, 2021
2 parents 8989ba6 + 86406d9 commit 72226d1
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 16 deletions.
10 changes: 5 additions & 5 deletions tests/all_mode/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function test_query_timeout() {
cp $cur/conf/dm-task.yaml $WORK_DIR/dm-task.yaml
sed -i "s/name: test/name: $ILLEGAL_CHAR_NAME/g" $WORK_DIR/dm-task.yaml
dmctl_start_task "$WORK_DIR/dm-task.yaml" "--remove-meta"
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$ILLEGAL_CHAR_NAME\"}" 3 1 3
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$ILLEGAL_CHAR_NAME\"}" 10 1 3

# `query-status` timeout
start_time=$(date +%s)
Expand Down Expand Up @@ -325,8 +325,8 @@ function run() {
sed -i "s/name: test/name: $ILLEGAL_CHAR_NAME/g" $WORK_DIR/dm-task.yaml
dmctl_start_task "$WORK_DIR/dm-task.yaml" "--remove-meta"
# check task has started
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$ILLEGAL_CHAR_NAME\"}" 3 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"$ILLEGAL_CHAR_NAME\"}" 3 1 3
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$ILLEGAL_CHAR_NAME\"}" 10 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"$ILLEGAL_CHAR_NAME\"}" 10 1 3

# use sync_diff_inspector to check full dump loader
check_sync_diff $WORK_DIR $cur/conf/diff_config.toml
Expand All @@ -350,8 +350,8 @@ function run() {
wait_pattern_exit dm-worker2.toml
run_dm_worker $WORK_DIR/worker2 $WORKER2_PORT $cur/conf/dm-worker2.toml
check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER2_PORT
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$ILLEGAL_CHAR_NAME\"}" 3 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"$ILLEGAL_CHAR_NAME\"}" 3 1 3
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$ILLEGAL_CHAR_NAME\"}" 10 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"$ILLEGAL_CHAR_NAME\"}" 10 1 3

sleep 10
echo "after restart dm-worker, task should resume automatically"
Expand Down
9 changes: 4 additions & 5 deletions tests/case_sensitive/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ function run() {
cp $cur/conf/dm-task.yaml $WORK_DIR/dm-task.yaml
dmctl_start_task "$WORK_DIR/dm-task.yaml" "--remove-meta"
# check task has started
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"test\"}" 3 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"test\"}" 3 1 3
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"test\"}" 10 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"test\"}" 10 1 3

# use sync_diff_inspector to check full dump loader
check_sync_diff $WORK_DIR $cur/conf/diff_config.toml
Expand All @@ -70,9 +70,8 @@ function run() {

# wait for task running
check_http_alive 127.0.0.1:$MASTER_PORT/apis/${API_VERSION}/status/test '"stage": "Running"' 10
sleep 2 # still wait for subtask running on other dm-workers
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"test\"}" 3 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"test\"}" 3 1 3
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"test\"}" 10 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"test\"}" 10 1 3

run_sql_file $cur/data/db1.increment.sql $MYSQL_HOST1 $MYSQL_PORT1 $MYSQL_PASSWORD1
run_sql_file $cur/data/db2.increment.sql $MYSQL_HOST2 $MYSQL_PORT2 $MYSQL_PASSWORD2
Expand Down
4 changes: 2 additions & 2 deletions tests/gtid/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function run() {
dmctl_operate_source create $WORK_DIR/source2.yaml $SOURCE_ID2

dmctl_start_task "$cur/conf/dm-task.yaml" "--remove-meta"
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"test\"}" 3 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"test\"}" 3 1 3
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"test\"}" 10 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"test\"}" 10 1 3

check_sync_diff $WORK_DIR $cur/conf/diff_config.toml

Expand Down
4 changes: 2 additions & 2 deletions tests/metrics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function check_secondsBehindMaster() {
query_msg=$(cat $WORK_DIR/query-status.log)
cnt=$(echo "${query_msg}" | jq -r --arg min_val $min_val '.sources[].subTaskStatus[].sync | select((.secondsBehindMaster|tonumber)>($min_val | tonumber)).secondsBehindMaster' | wc -l)
if [ $cnt != $need_cnt ]; then
echo "check secondsBehindMaster faild, cnt: $cnt need_cnt: $need_cnt"
echo "check secondsBehindMaster failed, cnt: $cnt need_cnt: $need_cnt"
exit 1
fi
}
Expand Down Expand Up @@ -87,7 +87,7 @@ function run() {
check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER2_PORT
check_sync_diff $WORK_DIR $cur/conf/diff_config.toml
# check the dmctl query-status no new dml, lag should be set to 0
run_dm_ctl $WORK_DIR "127.0.0.1:$MASTER_PORT" \
run_dm_ctl_with_retry $WORK_DIR "127.0.0.1:$MASTER_PORT" \
"query-status test" \
"\"secondsBehindMaster\": \"0\"" 2
echo "check zero job done!"
Expand Down
4 changes: 2 additions & 2 deletions tests/only_dml/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ function run() {
dmctl_start_task $cur/conf/dm-task.yaml

# check task has started state=2 running
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$TASK_NAME\"}" 3 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"$TASK_NAME\"}" 3 1 3
check_metric $WORKER1_PORT "dm_worker_task_state{source_id=\"mysql-replica-01\",task=\"$TASK_NAME\"}" 10 1 3
check_metric $WORKER2_PORT "dm_worker_task_state{source_id=\"mysql-replica-02\",task=\"$TASK_NAME\"}" 10 1 3

# check diff
check_sync_diff $WORK_DIR $cur/conf/diff_config.toml
Expand Down

0 comments on commit 72226d1

Please sign in to comment.