Skip to content

Commit

Permalink
fix unstable test
Browse files Browse the repository at this point in the history
Signed-off-by: lance6716 <[email protected]>
  • Loading branch information
lance6716 committed May 12, 2022
1 parent 5be2376 commit 983b24c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
11 changes: 7 additions & 4 deletions dm/tests/_utils/test_prepare
Original file line number Diff line number Diff line change
Expand Up @@ -311,15 +311,18 @@ function check_log_contain_with_retry() {
function init_cluster(){
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
run_dm_worker $WORK_DIR/worker1 $WORKER1_PORT $cur/conf/dm-worker1.toml
check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER1_PORT
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

cp $cur/conf/source1.yaml $WORK_DIR/source1.yaml
cp $cur/conf/source2.yaml $WORK_DIR/source2.yaml
sed -i "/relay-binlog-name/i\relay-dir: $WORK_DIR/worker1/relay_log" $WORK_DIR/source1.yaml
sed -i "/relay-binlog-name/i\relay-dir: $WORK_DIR/worker2/relay_log" $WORK_DIR/source2.yaml

run_dm_worker $WORK_DIR/worker1 $WORKER1_PORT $cur/conf/dm-worker1.toml
check_rpc_alive $cur/../bin/check_worker_online 127.0.0.1:$WORKER1_PORT
dmctl_operate_source create $WORK_DIR/source1.yaml $SOURCE_ID1

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
dmctl_operate_source create $WORK_DIR/source2.yaml $SOURCE_ID2
}

Expand Down
24 changes: 24 additions & 0 deletions dm/tests/shardddl4_1/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -911,73 +911,97 @@ function DM_155_CASE {
run_sql_source2 "insert into ${shardddl1}.${tb2} values(3,3,3);"

run_sql_source1 "alter table ${shardddl1}.${tb1} change c b int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(4,4,4);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(5,5,5);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(6,6,6);"

run_sql_source1 "alter table ${shardddl1}.${tb1} add column g int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(7,7,7,7);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(8,8,8);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(9,9,9);"

run_sql_source1 "alter table ${shardddl1}.${tb1} change d f int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(10,10,10,10);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(11,11,11);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(12,12,12);"

run_sql_source1 "alter table ${shardddl1}.${tb1} add column e int not null after f;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(13,13,13,13,13);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(14,14,14);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(15,15,15);"

run_sql_source2 "alter table ${shardddl1}.${tb1} change c b int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(16,16,16,16,16);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(17,17,17);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(18,18,18);"

run_sql_source2 "alter table ${shardddl1}.${tb1} change d f int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(19,19,19,19,19);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(20,20,20);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(21,21,21);"

run_sql_source2 "alter table ${shardddl1}.${tb1} add column g int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(22,22,22,22,22);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(23,23,23,23);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(24,24,24);"

run_sql_source2 "alter table ${shardddl1}.${tb1} add column e int not null after f;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(25,25,25,25,25);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(26,26,26,26,26);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(27,27,27);"

run_sql_source2 "alter table ${shardddl1}.${tb2} change c b int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(28,28,28,28,28);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(29,29,29,29,29);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(30,30,30);"

run_sql_source2 "alter table ${shardddl1}.${tb2} change d f int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(31,31,31,31,31);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(32,32,32,32,32);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(33,33,33);"

run_sql_source2 "alter table ${shardddl1}.${tb2} add column e int not null after f;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(34,34,34,34,34);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(35,35,35,35,35);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(36,36,36,36);"

run_sql_source2 "alter table ${shardddl1}.${tb2} add column g int;"
sleep 1
random_restart 3

run_sql_source1 "insert into ${shardddl1}.${tb1} values(37,37,37,37,37);"
run_sql_source2 "insert into ${shardddl1}.${tb1} values(38,38,38,38,38);"
run_sql_source2 "insert into ${shardddl1}.${tb2} values(39,39,39,39,39);"
Expand Down

0 comments on commit 983b24c

Please sign in to comment.