From f2620e3bfe7307b4aac66a037bf5f59f4c93a5fa Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Wed, 6 Jul 2022 12:00:03 +0800 Subject: [PATCH] test: adjust valgrind case --- tests/script/jenkins/basic.txt | 3 +- .../{checkError.sim => checkError1.sim} | 5 +-- tests/script/tsim/valgrind/checkError2.sim | 41 +++++++++++++++++++ 3 files changed, 45 insertions(+), 4 deletions(-) rename tests/script/tsim/valgrind/{checkError.sim => checkError1.sim} (88%) create mode 100644 tests/script/tsim/valgrind/checkError2.sim diff --git a/tests/script/jenkins/basic.txt b/tests/script/jenkins/basic.txt index 56b1bb8c15..0783aa0fd1 100644 --- a/tests/script/jenkins/basic.txt +++ b/tests/script/jenkins/basic.txt @@ -167,7 +167,8 @@ ./test.sh -f tsim/sma/rsmaPersistenceRecovery.sim # --- valgrind -./test.sh -f tsim/valgrind/checkError.sim +./test.sh -f tsim/valgrind/checkError1.sim +./test.sh -f tsim/valgrind/checkError2.sim # --- vnode # ./test.sh -f tsim/vnode/replica3_basic.sim diff --git a/tests/script/tsim/valgrind/checkError.sim b/tests/script/tsim/valgrind/checkError1.sim similarity index 88% rename from tests/script/tsim/valgrind/checkError.sim rename to tests/script/tsim/valgrind/checkError1.sim index 67f26c0f74..10c9cb5d6f 100644 --- a/tests/script/tsim/valgrind/checkError.sim +++ b/tests/script/tsim/valgrind/checkError1.sim @@ -33,13 +33,12 @@ print =============== step3: print =============== stop system sh/exec.sh -n dnode1 -s stop -x SIGINT +print =============== check print ----> start to check if there are ERRORS in vagrind log file for each dnode -# -n : dnode[x] be check system_content sh/checkValgrind.sh -n dnode1 -# temporarily expand the threshold, since no time to fix the memory leaks. print cmd return result ----> [ $system_content ] -if $system_content <= 10 then +if $system_content <= 40 then return 0 endi diff --git a/tests/script/tsim/valgrind/checkError2.sim b/tests/script/tsim/valgrind/checkError2.sim new file mode 100644 index 0000000000..cfc502bf3e --- /dev/null +++ b/tests/script/tsim/valgrind/checkError2.sim @@ -0,0 +1,41 @@ +system sh/stop_dnodes.sh +system sh/deploy.sh -n dnode1 -i 1 +system sh/exec.sh -n dnode1 -s start -v +sql connect + +print =============== step1: create drop show dnodes +$x = 0 +step1: + $x = $x + 1 + sleep 1000 + if $x == 10 then + print ----> dnode not ready! + return -1 + endi +sql show dnodes +print ----> $data00 $data01 $data02 $data03 $data04 $data05 +if $rows != 1 then + return -1 +endi + +print =============== step2: create db +sql create database db vgroups 1 + +_OVER: +system sh/exec.sh -n dnode1 -s stop -x SIGINT + +print =============== check +print ----> start to check if there are ERRORS in vagrind log file for each dnode +system_content sh/checkValgrind.sh -n dnode1 + +print cmd return result ----> [ $system_content ] +if $system_content <= 60 then + return 0 +endi + +$null= +if $system_content == $null then + return 0 +endi + +return -1