-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* modify socketTimeout to 120s * add regular match * support rc + Pessimistic * revert Fix pessimistic commit wait error * revert revert * add pprof * add pprof scripts
- Loading branch information
1 parent
6903fae
commit 141cfc9
Showing
10 changed files
with
179 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,3 +21,8 @@ jdbc: | |
user: | ||
name: "dump" | ||
password: "111" | ||
|
||
#debug info | ||
debug: | ||
serverIP: "127.0.0.1" | ||
port: 6060 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env bash | ||
if [ $# -eq 0 ] ; then | ||
echo "No parameters provided,please use -H to get help. " >&2 | ||
exit 2 | ||
fi | ||
|
||
PORT=6060 | ||
SERVER="127.0.0.1" | ||
DURATION=30 | ||
SLEEP=60 | ||
WORKSPACE=$(cd `dirname $0`; pwd) | ||
|
||
while getopts ":h:p:d:s:H" opt | ||
do | ||
case $opt in | ||
h) | ||
SERVER="${OPTARG}" | ||
echo -e "`date +'%Y-%m-%d %H:%M:%S'` The server addr is : ${OPTARG}" | ||
;; | ||
p) | ||
expr ${OPTARG} "+" 10 &> /dev/null | ||
if [ $? -ne 0 ]; then | ||
echo "`date +'%Y-%m-%d %H:%M:%S'` The port [${OPTARG}] is not a number" | ||
exit 1 | ||
fi | ||
PORT=${OPTARG} | ||
echo -e "`date +'%Y-%m-%d %H:%M:%S'` The debug port is : ${OPTARG}" | ||
;; | ||
d) | ||
DURATION=${OPTARG} | ||
echo -e "`date +'%Y-%m-%d %H:%M:%S'` The collection duration is : ${OPTARG} s" | ||
;; | ||
s) | ||
SLEEP=${OPTARG} | ||
echo -e "`date +'%Y-%m-%d %H:%M:%S'` The sleep time for each turn is : ${OPTARG} s" | ||
;; | ||
H) | ||
echo -e "Usage: bash pprof.sh [option] [param] ...\nExcute pprof task" | ||
echo -e " -h server address, default value is 127.0.0.1" | ||
echo -e " -p server port, default value is 6060" | ||
echo -e " -d the duration that pprof collection will last once, unit s" | ||
echo -e " -s the sleeptime for each turn, unit s" | ||
echo -e "Examples:" | ||
echo " bash pprof.sh -h 127.0.0.1 -p 6060 -d 10" | ||
echo "For more support,please email to [email protected]" | ||
exit 1 | ||
;; | ||
?) | ||
echo "Unkown parameter,please use -H to get help." | ||
exit 1;; | ||
esac | ||
done | ||
|
||
if [ ! -d ${WORKSPACE}/report/prof/${SERVER} ] ; then | ||
mkdir ${WORKSPACE}/report/prof/${SERVER} | ||
fi | ||
|
||
time=`date +'%Y-%m-%d_%H:%M:%S'` | ||
mkdir -p ${WORKSPACE}/report/prof/${SERVER}/${time} | ||
curl http://${SERVER}:${PORT}/debug/pprof/goroutine?debug=2 -o ${WORKSPACE}/report/prof/${SERVER}/${time}/goroutine.log | ||
curl http://${SERVER}:${PORT}/debug/pprof/trace?seconds=30 -o ${WORKSPACE}/report/prof/${SERVER}/${time}/trace.out | ||
if [ $? -ne 0 ];then | ||
echo -e "`date +'%Y-%m-%d_%H:%M:%S'` The MO debug service can not be reached, the pprof operation was failed." | ||
exit 1 | ||
fi | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ fi | |
|
||
TIMES=1 | ||
|
||
while getopts ":p:m:t:r:i:e:s:gfnch" opt | ||
while getopts ":p:m:t:r:i:e:s:ogfnch" opt | ||
do | ||
case $opt in | ||
p) | ||
|
@@ -58,6 +58,10 @@ do | |
CHECK="check" | ||
echo -e "The meta data of the resultset will be ignored when comparing the resut" | ||
;; | ||
o) | ||
PPROF="pprof" | ||
echo -e "If a query timeout, mo-tester will collect the pprof info from mo" | ||
;; | ||
h) | ||
echo -e "Usage: bash run.sh [option] [param] ...\nExcute test cases task" | ||
echo -e " -p set the path of test cases needed to be executed by mo-tester" | ||
|
@@ -75,6 +79,7 @@ do | |
echo -e " Those two sql commands are associated with the issue#3236,and they will not been executed in bvt test,until the flag is removed when the issue#3236 is fixed." | ||
echo -e " -n means the meta data of the resultset will be ignored when comparing the resut" | ||
echo -e " -c check whether the case scripts match the result file" | ||
echo -e " -o if a query timeout, mo-tester will collect the pprof info from mo" | ||
echo -e "Examples:" | ||
echo " bash run.sh -p case -m run -t script -r 100 -i select,subquery -e substring -g" | ||
echo "For more support,please email to [email protected]" | ||
|
@@ -104,7 +109,7 @@ if [ ${TIMES} -eq 1 ]; then | |
java -Xms1024M -Xmx1024M -cp ${libJars} \ | ||
-Dconf.yml=${MO_YAML} \ | ||
-Drun.yml=${RUN_YAML} \ | ||
io.mo.Tester ${PATHC} ${METHOD} ${TYPE} ${RATE} ${INCLUDE} ${EXCLUDE} ${IGNORE} ${NOMETA} ${CHECK} ${RESOURCE} ${FORCE} | ||
io.mo.Tester ${PATHC} ${METHOD} ${TYPE} ${RATE} ${INCLUDE} ${EXCLUDE} ${IGNORE} ${NOMETA} ${CHECK} ${RESOURCE} ${FORCE} ${PPROF} | ||
else | ||
echo "This test will be run for ${TIMES} times" | ||
for i in $(seq 1 ${TIMES}) | ||
|
@@ -113,7 +118,7 @@ else | |
java -Xms1024M -Xmx1024M -cp ${libJars} \ | ||
-Dconf.yml=${MO_YAML} \ | ||
-Drun.yml=${RUN_YAML} \ | ||
io.mo.Tester ${PATHC} ${METHOD} ${TYPE} ${RATE} ${INCLUDE} ${EXCLUDE} ${IGNORE} ${NOMETA} ${CHECK} ${RESOURCE} ${FORCE} | ||
io.mo.Tester ${PATHC} ${METHOD} ${TYPE} ${RATE} ${INCLUDE} ${EXCLUDE} ${IGNORE} ${NOMETA} ${CHECK} ${RESOURCE} ${FORCE} ${PPROF} | ||
echo "The ${i} turn test has ended, and test report is in ./report/${i} dir." | tee -a ${WORKSPACE}/run.log | ||
mkdir -p ${WORKSPACE}/${MOTESTER_DIR}/report/${i}/ | ||
mv ${WORKSPACE}/${MOTESTER_DIR}/report/*.txt ${WORKSPACE}/${MOTESTER_DIR}/report/${i}/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters