From 966b47361e86b2deb3419caf424a0c46de8072ce Mon Sep 17 00:00:00 2001 From: Hui Li Date: Wed, 29 Jul 2020 19:31:34 +0800 Subject: [PATCH] [modify cases] --- .../unique/clusterSimCase/client-06.sim | 10 +---- .../unique/clusterSimCase/client-07.sim | 41 ++++++++++++------- .../unique/clusterSimCase/client-08.sim | 30 +++++++------- .../unique/clusterSimCase/cluster_main.sim | 4 +- 4 files changed, 47 insertions(+), 38 deletions(-) diff --git a/tests/script/unique/clusterSimCase/client-06.sim b/tests/script/unique/clusterSimCase/client-06.sim index 013eb1db85..209b615e64 100644 --- a/tests/script/unique/clusterSimCase/client-06.sim +++ b/tests/script/unique/clusterSimCase/client-06.sim @@ -9,8 +9,6 @@ $tsStart = 1325347200000 # 2012-01-01 00:00:00.000 $preBinary = ' . client-06- $numPerUpdateTbl = 2000 ############################################################### -$testCnt = 0 - $totalRows = 0 $dropTblStart = $tblStart $dropTblEnd = $dropTblStart @@ -23,7 +21,7 @@ sql create database if not exists $db replica 2 sql use $db init_lable: -print ================ create table $tb [ from $tblStart to $tblEnd ] (ts timestamp, c1 int, c2 binary(16)) +print ================ create table [ from $tblStart to $tblEnd ] (ts timestamp, c1 int, c2 binary(16)) $i = $tblStart while $i < $tblEnd @@ -90,12 +88,8 @@ if $loopCnt > 2 then $i = $i + 1 $totalRows = $totalRows - $rowsPerTbl endw - sleep 20000 - $testCnt = $testCnt + 1 + sleep 10000 goto init_lable endi -if $testCnt > 10 then - return 0 -endi goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-07.sim b/tests/script/unique/clusterSimCase/client-07.sim index 0dde62248d..3bf3585205 100644 --- a/tests/script/unique/clusterSimCase/client-07.sim +++ b/tests/script/unique/clusterSimCase/client-07.sim @@ -7,6 +7,10 @@ $tblEnd = 10000 $tsStart = 1325347200000 # 2012-01-01 00:00:00.000 $preBinary = ' . client-07- ############################################################### +$alterCnt = 0 + +$columnA = c . $alterCnt +$columnB = d . $alterCnt $totalRows = 0 @@ -17,22 +21,23 @@ $db = db sql create database if not exists $db replica 2 sql use $db -init_lable: -print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) +$rowsPerTbl = 0 +$ts = $tsStart + +print ================ create table $tb (ts timestamp, $columnA int, $columnB binary(16)) $i = $tblStart while $i < $tblEnd $tb = tb . $i # print create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) - sql create table if not exists $tb ( ts timestamp , c1 int , c2 binary(16) ) + sql create table if not exists $tb ( ts timestamp , $columnA int , $columnB binary(16) ) $i = $i + 1 endw -$rowsPerTbl = 0 -$ts = $tsStart $rowsPerLoop = 160 $loopCnt = 0 +$alterStep = 0 loop_run: print ================ client-07 start loop insert data ( loopCnt: $loopCnt ) @@ -70,19 +75,27 @@ endi $loopCnt = $loopCnt + 1 -if $loopCnt > 100 then - +if $alterStep > 2 then + $alterStep = 0 + + $alterCnt = $alterCnt + 1 $i = $tblStart while $i < $tblEnd $tb = tb . $i - sql alter table $tb add column c3 double - sql alter table $tb add column c4 binary( 16 ) - sql alter table $tb drop column c1 - sql alter table $tb drop column c2 + $newColumnA = c . $alterCnt + $newcolumnB = d . $alterCnt + + sql alter table $tb add column $newColumnA double + sql alter table $tb add column $newcolumnB binary( 16 ) + sql alter table $tb drop column $columnA + sql alter table $tb drop column $columnB $i = $i + 1 - endw - sleep 20000 - goto init_lable + endw + $columnA = $newColumnA + $columnB = $newcolumnB + + sleep 10000 + goto loop_run endi goto loop_run diff --git a/tests/script/unique/clusterSimCase/client-08.sim b/tests/script/unique/clusterSimCase/client-08.sim index 891b3991b6..78608b2c42 100644 --- a/tests/script/unique/clusterSimCase/client-08.sim +++ b/tests/script/unique/clusterSimCase/client-08.sim @@ -4,13 +4,14 @@ ############################################################### ################ set script parameters ################ $tblStart = 0 -$tblEnd = 10000 +$tblEnd = 100 $tsStart = 1325347200000 # 2012-01-01 00:00:00.000 $preBinary = ' . client-08- -$numPerUpdateTbl = 2000 +$numPerUpdateTbl = 20 ############################################################### - -$totalRows = 0 +$totalRows = 0 +$dropTblStart = $tblStart +$dropTblEnd = $dropTblStart sql connect @@ -20,7 +21,7 @@ sql create database if not exists $db replica 2 sql use $db init_lable: -print ================ create table $tb (ts timestamp, c1 int, c2 binary(16)) +print ================ create table [ from $tblStart to $tblEnd ] (ts timestamp, c1 int, c2 binary(16)) $i = $tblStart while $i < $tblEnd @@ -30,8 +31,8 @@ while $i < $tblEnd $i = $i + 1 endw -$dropTblStart = $tblStart -$dropTblEnd = $tblStart + $numPerUpdateTbl +$dropTblStart = $dropTblEnd +$dropTblEnd = $dropTblStart + $numPerUpdateTbl $tblStart = $tblEnd $tblEnd = $tblEnd + $numPerUpdateTbl @@ -43,9 +44,9 @@ $rowsPerLoop = 40 $loopCnt = 0 loop_run: -print ================ client-08 start loop insert data ( loopCnt: $loopCnt ) -$i = $dropTblStart -while $i < $tblEnd +print ================ client-08 start loop insert data from $dropTblStart to $tblStart ( loopCnt: $loopCnt ) +$i = $dropTblStart +while $i < $tblStart $tb = tb . $i $c2Binary = $preBinary . $i @@ -58,7 +59,7 @@ while $i < $tblEnd $x = $x + 40 $ts = $ts + 40a endw - if $i == $tblStart then + if $i == $dropTblStart then $rowsPerTbl = $rowsPerTbl + $x endi @@ -68,7 +69,7 @@ while $i < $tblEnd endw sql select count(*) from $tb -print data00 $data00 rowsPerTbl $rowsPerTbl +print data00 $data00 rowsPerTbl $rowsPerTbl tb: $tb if $data00 != $rowsPerTbl then print ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ print ************ client-08 insert data into $tb error ***** ***** @@ -78,7 +79,8 @@ endi $loopCnt = $loopCnt + 1 -#if $loopCnt > 100 then +#if $loopCnt > 3 then + print ================ client-08 drop table from $dropTblStart to $dropTblEnd $i = $dropTblStart while $i < $dropTblEnd $tb = tb . $i @@ -86,7 +88,7 @@ $loopCnt = $loopCnt + 1 $i = $i + 1 $totalRows = $totalRows - $rowsPerTbl endw - sleep 20000 + sleep 10000 goto init_lable #endi diff --git a/tests/script/unique/clusterSimCase/cluster_main.sim b/tests/script/unique/clusterSimCase/cluster_main.sim index a2ca34b189..39607c2915 100644 --- a/tests/script/unique/clusterSimCase/cluster_main.sim +++ b/tests/script/unique/clusterSimCase/cluster_main.sim @@ -94,11 +94,11 @@ print ============== step3: start back client-01.sim #run_back unique/clusterSimCase/client-01.sim #run_back unique/clusterSimCase/client-02.sim #run_back unique/clusterSimCase/client-03.sim -run_back unique/clusterSimCase/client-04.sim +#run_back unique/clusterSimCase/client-04.sim #run_back unique/clusterSimCase/client-05.sim #run_back unique/clusterSimCase/client-06.sim #run_back unique/clusterSimCase/client-07.sim -#run_back unique/clusterSimCase/client-08.sim +run_back unique/clusterSimCase/client-08.sim #run_back unique/clusterSimCase/client-01.sim #run_back unique/clusterSimCase/client-01.sim sleep 20000 -- GitLab