From ebbdf01aa0db405017a357fa1db6f535628c9e59 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 23 Dec 2020 11:33:01 +0800 Subject: [PATCH] [TD-2491][TD-2492]modify Jenkinsfile --- tests/Jenkinsfile | 82 ++++++++++++------------ tests/pytest/concurrent_inquiry.py | 8 ++- tests/pytest/handle_crash_gen_val_log.sh | 7 +- 3 files changed, 51 insertions(+), 46 deletions(-) diff --git a/tests/Jenkinsfile b/tests/Jenkinsfile index aae81c19f4..e7d8a0b70f 100644 --- a/tests/Jenkinsfile +++ b/tests/Jenkinsfile @@ -50,12 +50,7 @@ pipeline { agent{label 'master'} steps { pre_test() - catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { - sh ''' - cd ${WKC}/tests/pytest - python3 concurrent_inquiry.py -c 1 - ''' - } + sh ''' cd ${WKC}/tests ./test-all.sh b1 @@ -82,53 +77,26 @@ pipeline { ./handle_crash_gen_val_log.sh ''' } - sh ''' - cd ${WKC}/tests - ./test-all.sh b2 - date - ''' - } - } - - stage('test_valgrind') { - agent{label "186"} - - steps { - pre_test() - sh ''' - cd ${WKC}/tests/pytest - ./valgrind-test.sh 2>&1 > mem-error-out.log - ./handle_val_log.sh - - date - cd ${WKC}/tests - ./test-all.sh b3 - date''' - } - } - stage('connector'){ - agent{label "release"} - steps{ sh''' - cd ${WORKSPACE} - git checkout develop + systemctl start taosd + sleep 10 ''' catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' - cd ${WORKSPACE}/tests/gotest + cd ${WKC}/tests/gotest bash batchtest.sh ''' } catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' - cd ${WORKSPACE}/tests/examples/python/PYTHONConnectorChecker + cd ${WKC}/tests/examples/python/PYTHONConnectorChecker python3 PythonChecker.py ''' } catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' - cd ${WORKSPACE}/tests/examples/JDBC/JDBCDemo/ - mvn clean package assembly:single >/dev/null + cd ${WKC}/tests/examples/JDBC/JDBCDemo/ + mvn clean package assembly:single -DskipTests >/dev/null java -jar target/jdbcChecker-SNAPSHOT-jar-with-dependencies.jar -host 127.0.0.1 ''' } @@ -138,9 +106,41 @@ pipeline { dotnet run ''' } + sh ''' + systemctl stop taosd + cd ${WKC}/tests + ./test-all.sh b2 + date + ''' + } + } + + stage('test_valgrind') { + agent{label "186"} + + steps { + pre_test() + catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { + sh ''' + cd ${WKC}/tests/pytest + nohup taosd >/dev/null & + sleep 10 + python3 concurrent_inquiry.py -c 1 + + ''' + } + sh ''' + cd ${WKC}/tests/pytest + ./valgrind-test.sh 2>&1 > mem-error-out.log + ./handle_val_log.sh - } - } + date + cd ${WKC}/tests + ./test-all.sh b3 + date''' + } + } + stage('arm64_build'){ agent{label 'arm64'} steps{ diff --git a/tests/pytest/concurrent_inquiry.py b/tests/pytest/concurrent_inquiry.py index 9a8c359e4e..7bdab8bc67 100644 --- a/tests/pytest/concurrent_inquiry.py +++ b/tests/pytest/concurrent_inquiry.py @@ -388,7 +388,9 @@ class ConcurrentInquiry: print( "Failure thread%d, sql: %s \nexception: %s" % (threadID, str(sql),str(e))) - #exit(-1) + err_uec='Unable to establish connection' + if err_uec in str(e) and loop >0: + exit(-1) loop -= 1 if loop == 0: break @@ -415,7 +417,9 @@ class ConcurrentInquiry: print( "Failure thread%d, sql: %s \nexception: %s" % (threadID, str(sql),str(e))) - #exit(-1) + err_uec='Unable to establish connection' + if err_uec in str(e) and loop >0: + exit(-1) loop -= 1 if loop == 0: break diff --git a/tests/pytest/handle_crash_gen_val_log.sh b/tests/pytest/handle_crash_gen_val_log.sh index f00fe40c69..cb37661789 100755 --- a/tests/pytest/handle_crash_gen_val_log.sh +++ b/tests/pytest/handle_crash_gen_val_log.sh @@ -5,9 +5,10 @@ GREEN='\033[1;32m' GREEN_DARK='\033[0;32m' GREEN_UNDERLINE='\033[4;32m' NC='\033[0m' -nohup /var/lib/jenkins/workspace/TDinternal/debug/build/bin/taosd -c /var/lib/jenkins/workspace/TDinternal/community/sim/dnode1/cfg >/dev/null & +#nohup /var/lib/jenkins/workspace/TDinternal/debug/build/bin/taosd -c /var/lib/jenkins/workspace/TDinternal/community/sim/dnode1/cfg >/dev/null & +nohup /root/TDinternal/debug/build/bin/taosd -c /root/TDinternal/community/sim/dnode1/cfg >/dev/null & ./crash_gen.sh --valgrind -p -t 10 -s 250 -b 4 -pidof taosd|xargs kill +pidof taosd|xargs kill -9 grep 'start to execute\|ERROR SUMMARY' valgrind.err|grep -v 'grep'|uniq|tee crash_gen_mem_err.log for memError in `grep 'ERROR SUMMARY' crash_gen_mem_err.log | awk '{print $4}'` @@ -31,4 +32,4 @@ if [ -n "$defiMemError" ]; then exit 8 fi fi -done \ No newline at end of file +done -- GitLab