From 8f7f40f75d292c145478cca9a5665f26a4010601 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Mon, 20 May 2024 17:12:42 +0800 Subject: [PATCH 1/3] test:collect unit-test log in ci --- tests/parallel_test/run.sh | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/tests/parallel_test/run.sh b/tests/parallel_test/run.sh index ef9413a9d5..e58f890ccd 100755 --- a/tests/parallel_test/run.sh +++ b/tests/parallel_test/run.sh @@ -315,19 +315,22 @@ function run_thread() { fi if [ -n "$corefile" ]; then echo -e "\e[34m corefiles: $corefile \e[0m" - local build_dir=$log_dir/build_${hosts[index]} - local remote_build_dir="${workdirs[index]}/${DEBUGPATH}/build" - # if [ $ent -ne 0 ]; then - # remote_build_dir="${workdirs[index]}/{DEBUGPATH}/build" - # fi - mkdir "$build_dir" 2>/dev/null - if [ $? -eq 0 ]; then - # scp build binary - cmd="$scpcmd:${remote_build_dir}/* ${build_dir}/" - echo "$cmd" - $cmd >/dev/null - fi fi + # scp build binary and unit test log + local build_dir=$log_dir/build_${hosts[index]} + local remote_build_dir="${workdirs[index]}/${DEBUGPATH}/build" + local remote_unit_test_log_dir="${workdirs[index]}/${DEBUGPATH}/Testing/Temporary/" + + mkdir "$build_dir" 2>/dev/null + if [ $? -eq 0 ]; then + cmd="$scpcmd:${remote_build_dir}/* ${build_dir}/" + echo "$cmd" + $cmd >/dev/null + cmd="$scpcmd:${remote_unit_test_log_dir}/* ${build_dir}/" + echo "$cmd" + $cmd >/dev/null + fi + # get remote sim dir local remote_sim_dir="${workdirs[index]}/tmp/thread_volume/$thread_no" local tarcmd="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" From 69b2c9fecaa1358145a19b7064e5837837c80df8 Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 21 May 2024 15:45:18 +0800 Subject: [PATCH 2/3] test:print error message in ci of address sanitizer test --- tests/system-test/pytest.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system-test/pytest.sh b/tests/system-test/pytest.sh index 2837c817be..060717c20e 100755 --- a/tests/system-test/pytest.sh +++ b/tests/system-test/pytest.sh @@ -89,8 +89,8 @@ else export LD_PRELOAD="$(realpath "$(gcc -print-file-name=libasan.so)") $(realpath "$(gcc -print-file-name=libstdc++.so)")" echo "Preload AsanSo:" $? - $* -a 2>$AsanFile - + $* -a 2> $AsanFile + cat $AsanFile unset LD_PRELOAD for ((i = 1; i <= 20; i++)); do AsanFileLen=$(cat $AsanFile | wc -l) From 9881a833a6873c2c369ee63b7f24c0e05b6c7abd Mon Sep 17 00:00:00 2001 From: chenhaoran Date: Tue, 21 May 2024 19:07:50 +0800 Subject: [PATCH 3/3] test:modify testcase for TD-30187 --- tests/system-test/8-stream/stream_multi_agg.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/system-test/8-stream/stream_multi_agg.py b/tests/system-test/8-stream/stream_multi_agg.py index 3532825493..acb80f528b 100644 --- a/tests/system-test/8-stream/stream_multi_agg.py +++ b/tests/system-test/8-stream/stream_multi_agg.py @@ -39,7 +39,7 @@ class TDTestCase: os.system("nohup taosBenchmark -y -B 1 -t 40 -S 1000 -n 10 -i 1000 -v 5 > /dev/null 2>&1 &") time.sleep(10) - tdSql.query("use test") + tdSql.execute("use test", queryTimes=100) tdSql.query("create stream if not exists s1 trigger at_once ignore expired 0 ignore update 0 fill_history 1 into st1 as select _wstart,sum(voltage),groupid from meters partition by groupid interval(2s)") tdLog.debug("========create stream and insert data ok========") time.sleep(15) @@ -66,7 +66,7 @@ class TDTestCase: os.system("taosBenchmark -d db -t 20 -v 6 -n 1000 -y > /dev/null 2>&1") # create stream - tdSql.execute("use db") + tdSql.execute("use db", queryTimes=100) tdSql.execute("create stream stream1 fill_history 1 into sta as select count(*) as cnt from meters interval(10a);",show=True) time.sleep(5)