Merge pull request #24351 from taosdata/test/3.0/TD-28171

test: save case.sql when case is failed and set default saved sqlfile True
This commit is contained in:
Alex Duan 2024-01-09 09:21:23 +08:00 committed by GitHub
commit 70db802e57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
96 changed files with 276 additions and 261 deletions

View File

@ -15,61 +15,61 @@ function usage() {
ent=0 ent=0
while getopts "m:t:b:l:o:w:eh" opt; do while getopts "m:t:b:l:o:w:eh" opt; do
case $opt in case $opt in
m) m)
config_file=$OPTARG config_file=$OPTARG
;; ;;
t) t)
t_file=$OPTARG t_file=$OPTARG
;; ;;
b) b)
branch=$OPTARG branch=$OPTARG
;; ;;
l) l)
log_dir=$OPTARG log_dir=$OPTARG
;; ;;
e) e)
ent=1 ent=1
;; ;;
o) o)
timeout_param="-o $OPTARG" timeout_param="-o $OPTARG"
;; ;;
w) w)
web_server=$OPTARG web_server=$OPTARG
;; ;;
h) h)
usage usage
exit 0 exit 0
;; ;;
\?) \?)
echo "Invalid option: -$OPTARG" echo "Invalid option: -$OPTARG"
usage usage
exit 0 exit 0
;; ;;
esac esac
done done
#config_file=$1 #config_file=$1
if [ -z $config_file ]; then if [ -z "$config_file" ]; then
usage usage
exit 1 exit 1
fi fi
if [ ! -f $config_file ]; then if [ ! -f "$config_file" ]; then
echo "$config_file not found" echo "$config_file not found"
usage usage
exit 1 exit 1
fi fi
#t_file=$2 #t_file=$2
if [ -z $t_file ]; then if [ -z "$t_file" ]; then
usage usage
exit 1 exit 1
fi fi
if [ ! -f $t_file ]; then if [ ! -f "$t_file" ]; then
echo "$t_file not found" echo "$t_file not found"
usage usage
exit 1 exit 1
fi fi
date_tag=`date +%Y%m%d-%H%M%S` date_tag=$(date +%Y%m%d-%H%M%S)
test_log_dir=${branch}_${date_tag} test_log_dir=${branch}_${date_tag}
if [ -z $log_dir ]; then if [ -z "$log_dir" ]; then
log_dir="log/${test_log_dir}" log_dir="log/${test_log_dir}"
else else
log_dir="$log_dir/${test_log_dir}" log_dir="$log_dir/${test_log_dir}"
@ -82,42 +82,41 @@ workdirs=()
threads=() threads=()
i=0 i=0
while [ 1 ]; do while true; do
host=`jq .[$i].host $config_file` host=$(jq .[$i].host "$config_file")
if [ "$host" = "null" ]; then if [ "$host" = "null" ]; then
break break
fi fi
username=`jq .[$i].username $config_file` username=$(jq .[$i].username "$config_file")
if [ "$username" = "null" ]; then if [ "$username" = "null" ]; then
break break
fi fi
password=`jq .[$i].password $config_file` password=$(jq .[$i].password "$config_file")
if [ "$password" = "null" ]; then if [ "$password" = "null" ]; then
password="" password=""
fi fi
workdir=`jq .[$i].workdir $config_file` workdir=$(jq .[$i].workdir "$config_file")
if [ "$workdir" = "null" ]; then if [ "$workdir" = "null" ]; then
break break
fi fi
thread=`jq .[$i].thread $config_file` thread=$(jq .[$i].thread "$config_file")
if [ "$thread" = "null" ]; then if [ "$thread" = "null" ]; then
break break
fi fi
hosts[i]=`echo $host|sed 's/\"$//'|sed 's/^\"//'` hosts[i]=$(echo "$host" | sed 's/\"$//' | sed 's/^\"//')
usernames[i]=`echo $username|sed 's/\"$//'|sed 's/^\"//'` usernames[i]=$(echo "$username" | sed 's/\"$//' | sed 's/^\"//')
passwords[i]=`echo $password|sed 's/\"$//'|sed 's/^\"//'` passwords[i]=$(echo "$password" | sed 's/\"$//' | sed 's/^\"//')
workdirs[i]=`echo $workdir|sed 's/\"$//'|sed 's/^\"//'` workdirs[i]=$(echo "$workdir" | sed 's/\"$//' | sed 's/^\"//')
threads[i]=$thread threads[i]=$thread
i=$(( i + 1 )) i=$((i + 1))
done done
function prepare_cases() { function prepare_cases() {
cat $t_file >>$task_file cat "$t_file" >>"$task_file"
local i=0 local i=0
while [ $i -lt $1 ]; do while [ $i -lt "$1" ]; do
echo "%%FINISHED%%" >>$task_file echo "%%FINISHED%%" >>"$task_file"
i=$(( i + 1 )) i=$((i + 1))
done done
} }
@ -125,7 +124,7 @@ function clean_tmp() {
# clean tmp dir # clean tmp dir
local index=$1 local index=$1
local ssh_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}" local ssh_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then if [ -z "${passwords[index]}" ]; then
ssh_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}" ssh_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
fi fi
local cmd="${ssh_script} rm -rf ${workdirs[index]}/tmp" local cmd="${ssh_script} rm -rf ${workdirs[index]}/tmp"
@ -136,7 +135,7 @@ function run_thread() {
local index=$1 local index=$1
local thread_no=$2 local thread_no=$2
local runcase_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}" local runcase_script="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then if [ -z "${passwords[index]}" ]; then
runcase_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}" runcase_script="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
fi fi
local count=0 local count=0
@ -147,8 +146,9 @@ function run_thread() {
local cmd="${runcase_script} ${script}" local cmd="${runcase_script} ${script}"
# script="echo" # script="echo"
while [ 1 ]; do while true; do
local line=`flock -x $lock_file -c "head -n1 $task_file;sed -i \"1d\" $task_file"` local line
line=$(flock -x "$lock_file" -c "head -n1 $task_file;sed -i \"1d\" $task_file")
if [ "x$line" = "x%%FINISHED%%" ]; then if [ "x$line" = "x%%FINISHED%%" ]; then
# echo "$index . $thread_no EXIT" # echo "$index . $thread_no EXIT"
break break
@ -156,15 +156,17 @@ function run_thread() {
if [ -z "$line" ]; then if [ -z "$line" ]; then
continue continue
fi fi
echo "$line"|grep -q "^#"
if [ $? -eq 0 ]; then if echo "$line" | grep -q "^#"; then
continue continue
fi fi
local case_redo_time=`echo "$line"|cut -d, -f2` local case_redo_time
case_redo_time=$(echo "$line" | cut -d, -f2)
if [ -z "$case_redo_time" ]; then if [ -z "$case_redo_time" ]; then
case_redo_time=${DEFAULT_RETRY_TIME:-2} case_redo_time=${DEFAULT_RETRY_TIME:-2}
fi fi
local case_build_san=`echo "$line"|cut -d, -f3` local case_build_san
case_build_san=$(echo "$line" | cut -d, -f3)
if [ "${case_build_san}" == "y" ]; then if [ "${case_build_san}" == "y" ]; then
case_build_san="y" case_build_san="y"
DEBUGPATH="debugSan" DEBUGPATH="debugSan"
@ -175,139 +177,150 @@ function run_thread() {
usage usage
exit 1 exit 1
fi fi
local exec_dir=`echo "$line"|cut -d, -f4` local exec_dir
local case_cmd=`echo "$line"|cut -d, -f5` exec_dir=$(echo "$line" | cut -d, -f4)
local case_cmd
case_cmd=$(echo "$line" | cut -d, -f5)
local case_file="" local case_file=""
echo "$case_cmd"|grep -q "\.sh"
if [ $? -eq 0 ]; then if echo "$case_cmd" | grep -q "\.sh"; then
case_file=`echo "$case_cmd"|grep -o ".*\.sh"|awk '{print $NF}'` case_file=$(echo "$case_cmd" | grep -o ".*\.sh" | awk '{print $NF}')
fi fi
echo "$case_cmd"|grep -q "^python3"
if [ $? -eq 0 ]; then if echo "$case_cmd" | grep -q "^python3"; then
case_file=`echo "$case_cmd"|grep -o ".*\.py"|awk '{print $NF}'` case_file=$(echo "$case_cmd" | grep -o ".*\.py" | awk '{print $NF}')
fi fi
echo "$case_cmd"|grep -q "^./pytest.sh"
if [ $? -eq 0 ]; then if echo "$case_cmd" | grep -q "^./pytest.sh"; then
case_file=`echo "$case_cmd"|grep -o ".*\.py"|awk '{print $NF}'` case_file=$(echo "$case_cmd" | grep -o ".*\.py" | awk '{print $NF}')
fi fi
echo "$case_cmd"|grep -q "\.sim"
if [ $? -eq 0 ]; then if echo "$case_cmd" | grep -q "\.sim"; then
case_file=`echo "$case_cmd"|grep -o ".*\.sim"|awk '{print $NF}'` case_file=$(echo "$case_cmd" | grep -o ".*\.sim" | awk '{print $NF}')
fi fi
if [ -z "$case_file" ]; then if [ -z "$case_file" ]; then
case_file=`echo "$case_cmd"|awk '{print $NF}'` case_file=$(echo "$case_cmd" | awk '{print $NF}')
fi fi
if [ -z "$case_file" ]; then if [ -z "$case_file" ]; then
continue continue
fi fi
case_sql_file="$exec_dir/${case_file}.sql"
case_file="$exec_dir/${case_file}.${index}.${thread_no}.${count}" case_file="$exec_dir/${case_file}.${index}.${thread_no}.${count}"
count=$(( count + 1 )) count=$((count + 1))
local case_path=`dirname "$case_file"` local case_path
if [ ! -z "$case_path" ]; then case_path=$(dirname "$case_file")
mkdir -p $log_dir/$case_path if [ -n "$case_path" ]; then
mkdir -p "$log_dir"/"$case_path"
fi fi
cmd="${runcase_script} ${script} -w ${workdirs[index]} -c \"${case_cmd}\" -t ${thread_no} -d ${exec_dir} -s ${case_build_san} ${timeout_param}" cmd="${runcase_script} ${script} -w ${workdirs[index]} -c \"${case_cmd}\" -t ${thread_no} -d ${exec_dir} -s ${case_build_san} ${timeout_param}"
# echo "$thread_no $count $cmd" # echo "$thread_no $count $cmd"
local ret=0 local ret=0
local redo_count=1 local redo_count=1
local case_log_file=$log_dir/${case_file}.txt local case_log_file=$log_dir/${case_file}.txt
start_time=`date +%s` start_time=$(date +%s)
local case_index=`flock -x $lock_file -c "sh -c \"echo \\\$(( \\\$( cat $index_file ) + 1 )) | tee $index_file\""` local case_index
case_index=`printf "%5d" $case_index` case_index=$(flock -x "$lock_file" -c "sh -c \"echo \$(( \$( cat $index_file ) + 1 )) | tee $index_file\"")
local case_info=`echo "$line"|cut -d, -f 3,4,5` case_index=$(printf "%5d" "$case_index")
local case_info
case_info=$(echo "$line" | cut -d, -f 3,4,5)
while [ ${redo_count} -lt 6 ]; do while [ ${redo_count} -lt 6 ]; do
if [ -f $case_log_file ]; then if [ -f "$case_log_file" ]; then
cp $case_log_file $log_dir/$case_file.${redo_count}.redotxt cp "$case_log_file" "$log_dir"/"$case_file".${redo_count}.redotxt
fi fi
echo "${hosts[index]}-${thread_no} order:${count}, redo:${redo_count} task:${line}" >$case_log_file echo "${hosts[index]}-${thread_no} order:${count}, redo:${redo_count} task:${line}" >"$case_log_file"
local current_time=`date "+%Y-%m-%d %H:%M:%S"` local current_time
current_time=$(date "+%Y-%m-%d %H:%M:%S")
echo -e "$case_index \e[33m START >>>>> \e[0m ${case_info} \e[33m[$current_time]\e[0m" echo -e "$case_index \e[33m START >>>>> \e[0m ${case_info} \e[33m[$current_time]\e[0m"
echo "$current_time" >>$case_log_file echo "$current_time" >>"$case_log_file"
local real_start_time=`date +%s` local real_start_time
real_start_time=$(date +%s)
# $cmd 2>&1 | tee -a $case_log_file # $cmd 2>&1 | tee -a $case_log_file
# ret=${PIPESTATUS[0]} # ret=${PIPESTATUS[0]}
$cmd >>$case_log_file 2>&1 $cmd >>"$case_log_file" 2>&1
ret=$? ret=$?
local real_end_time=`date +%s` local real_end_time
local time_elapsed=$(( real_end_time - real_start_time )) real_end_time=$(date +%s)
echo "execute time: ${time_elapsed}s" >>$case_log_file local time_elapsed
current_time=`date "+%Y-%m-%d %H:%M:%S"` time_elapsed=$((real_end_time - real_start_time))
echo "${hosts[index]} $current_time exit code:${ret}" >>$case_log_file echo "execute time: ${time_elapsed}s" >>"$case_log_file"
current_time=$(date "+%Y-%m-%d %H:%M:%S")
echo "${hosts[index]} $current_time exit code:${ret}" >>"$case_log_file"
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
break break
fi fi
redo=0 redo=0
grep -q "wait too long for taosd start" $case_log_file
if [ $? -eq 0 ]; then if grep -q "wait too long for taosd start" "$case_log_file"; then
redo=1 redo=1
fi fi
grep -q "kex_exchange_identification: Connection closed by remote host" $case_log_file
if [ $? -eq 0 ]; then if grep -q "kex_exchange_identification: Connection closed by remote host" "$case_log_file"; then
redo=1 redo=1
fi fi
grep -q "ssh_exchange_identification: Connection closed by remote host" $case_log_file
if [ $? -eq 0 ]; then if grep -q "ssh_exchange_identification: Connection closed by remote host" "$case_log_file"; then
redo=1 redo=1
fi fi
grep -q "kex_exchange_identification: read: Connection reset by peer" $case_log_file
if [ $? -eq 0 ]; then if grep -q "kex_exchange_identification: read: Connection reset by peer" "$case_log_file"; then
redo=1 redo=1
fi fi
grep -q "Database not ready" $case_log_file
if [ $? -eq 0 ]; then if grep -q "Database not ready" "$case_log_file"; then
redo=1 redo=1
fi fi
grep -q "Unable to establish connection" $case_log_file
if [ $? -eq 0 ]; then if grep -q "Unable to establish connection" "$case_log_file"; then
redo=1 redo=1
fi fi
if [ $redo_count -lt $case_redo_time ]; then if [ $redo_count -lt "$case_redo_time" ]; then
redo=1 redo=1
fi fi
if [ $redo -eq 0 ]; then if [ $redo -eq 0 ]; then
break break
fi fi
redo_count=$(( redo_count + 1 )) redo_count=$((redo_count + 1))
done done
end_time=`date +%s` end_time=$(date +%s)
echo >>$case_log_file echo >>"$case_log_file"
total_time=$(( end_time - start_time )) total_time=$((end_time - start_time))
echo "${hosts[index]} total time: ${total_time}s" >>$case_log_file echo "${hosts[index]} total time: ${total_time}s" >>"$case_log_file"
# echo "$thread_no ${line} DONE" # echo "$thread_no ${line} DONE"
if [ $ret -eq 0 ]; then if [ $ret -eq 0 ]; then
echo -e "$case_index \e[34m DONE <<<<< \e[0m ${case_info} \e[34m[${total_time}s]\e[0m \e[32m success\e[0m" echo -e "$case_index \e[34m DONE <<<<< \e[0m ${case_info} \e[34m[${total_time}s]\e[0m \e[32m success\e[0m"
flock -x $lock_file -c "echo \"${case_info}|success|${total_time}\" >>${success_case_file}" flock -x "$lock_file" -c "echo \"${case_info}|success|${total_time}\" >>${success_case_file}"
else else
if [ ! -z ${web_server} ]; then if [ -n "${web_server}" ]; then
flock -x $lock_file -c "echo -e \"${hosts[index]} ret:${ret} ${line}\n ${web_server}/$test_log_dir/${case_file}.txt\" >>${failed_case_file}" flock -x "$lock_file" -c "echo -e \"${hosts[index]} ret:${ret} ${line}\n ${web_server}/$test_log_dir/${case_file}.txt\" >>${failed_case_file}"
else else
flock -x $lock_file -c "echo -e \"${hosts[index]} ret:${ret} ${line}\n log file: ${case_log_file}\" >>${failed_case_file}" flock -x "$lock_file" -c "echo -e \"${hosts[index]} ret:${ret} ${line}\n log file: ${case_log_file}\" >>${failed_case_file}"
fi fi
mkdir -p $log_dir/${case_file}.coredump mkdir -p "${log_dir}"/"${case_file}".coredump
local remote_coredump_dir="${workdirs[index]}/tmp/thread_volume/$thread_no/coredump" local remote_coredump_dir="${workdirs[index]}/tmp/thread_volume/$thread_no/coredump"
local scpcmd="sshpass -p ${passwords[index]} scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" local scpcmd="sshpass -p ${passwords[index]} scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then if [ -z "${passwords[index]}" ]; then
scpcmd="scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" scpcmd="scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}"
fi fi
cmd="$scpcmd:${remote_coredump_dir}/* $log_dir/${case_file}.coredump/" cmd="$scpcmd:${remote_coredump_dir}/* $log_dir/${case_file}.coredump/"
$cmd # 2>/dev/null $cmd # 2>/dev/null
local corefile=`ls $log_dir/${case_file}.coredump/` local corefile
corefile=$(ls "$log_dir/${case_file}.coredump/")
echo -e "$case_index \e[34m DONE <<<<< \e[0m ${case_info} \e[34m[${total_time}s]\e[0m \e[31m failed\e[0m" echo -e "$case_index \e[34m DONE <<<<< \e[0m ${case_info} \e[34m[${total_time}s]\e[0m \e[31m failed\e[0m"
echo "=========================log============================" echo "=========================log============================"
cat $case_log_file cat "$case_log_file"
echo "=====================================================" echo "====================================================="
echo -e "\e[34m log file: $case_log_file \e[0m" echo -e "\e[34m log file: $case_log_file \e[0m"
if [ ! -z "${web_server}" ]; then if [ -n "${web_server}" ]; then
echo "${web_server}/$test_log_dir/${case_file}.txt" echo "${web_server}/$test_log_dir/${case_file}.txt"
fi fi
if [ ! -z "$corefile" ]; then if [ -n "$corefile" ]; then
echo -e "\e[34m corefiles: $corefile \e[0m" echo -e "\e[34m corefiles: $corefile \e[0m"
local build_dir=$log_dir/build_${hosts[index]} local build_dir=$log_dir/build_${hosts[index]}
local remote_build_dir="${workdirs[index]}/${DEBUGPATH}/build" local remote_build_dir="${workdirs[index]}/${DEBUGPATH}/build"
# if [ $ent -ne 0 ]; then # if [ $ent -ne 0 ]; then
# remote_build_dir="${workdirs[index]}/{DEBUGPATH}/build" # remote_build_dir="${workdirs[index]}/{DEBUGPATH}/build"
# fi # fi
mkdir $build_dir 2>/dev/null mkdir "$build_dir" 2>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
# scp build binary # scp build binary
cmd="$scpcmd:${remote_build_dir}/* ${build_dir}/" cmd="$scpcmd:${remote_build_dir}/* ${build_dir}/"
@ -318,18 +331,21 @@ function run_thread() {
# get remote sim dir # get remote sim dir
local remote_sim_dir="${workdirs[index]}/tmp/thread_volume/$thread_no" 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]}" local tarcmd="sshpass -p ${passwords[index]} ssh -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then if [ -z "${passwords[index]}" ]; then
tarcmd="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}" tarcmd="ssh -o StrictHostKeyChecking=no ${usernames[index]}@${hosts[index]}"
fi fi
cmd="$tarcmd sh -c \"cd $remote_sim_dir; tar -czf sim.tar.gz sim\"" cmd="$tarcmd sh -c \"cd $remote_sim_dir; tar -czf sim.tar.gz sim\""
$cmd $cmd
local remote_sim_tar="${workdirs[index]}/tmp/thread_volume/$thread_no/sim.tar.gz" local remote_sim_tar="${workdirs[index]}/tmp/thread_volume/$thread_no/sim.tar.gz"
local remote_case_sql_file="${workdirs[index]}/tmp/thread_volume/$thread_no/${case_sql_file}"
scpcmd="sshpass -p ${passwords[index]} scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" scpcmd="sshpass -p ${passwords[index]} scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}"
if [ -z ${passwords[index]} ]; then if [ -z "${passwords[index]}" ]; then
scpcmd="scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}" scpcmd="scp -o StrictHostKeyChecking=no -r ${usernames[index]}@${hosts[index]}"
fi fi
cmd="$scpcmd:${remote_sim_tar} $log_dir/${case_file}.sim.tar.gz" cmd="$scpcmd:${remote_sim_tar} $log_dir/${case_file}.sim.tar.gz"
$cmd $cmd
cmd="$scpcmd:${remote_case_sql_file} $log_dir/${case_file}.sql"
$cmd
# backup source code (disabled) # backup source code (disabled)
source_tar_dir=$log_dir/TDengine_${hosts[index]} source_tar_dir=$log_dir/TDengine_${hosts[index]}
source_tar_file=TDengine.tar.gz source_tar_file=TDengine.tar.gz
@ -337,11 +353,9 @@ function run_thread() {
source_tar_dir=$log_dir/TDinternal_${hosts[index]} source_tar_dir=$log_dir/TDinternal_${hosts[index]}
source_tar_file=TDinternal.tar.gz source_tar_file=TDinternal.tar.gz
fi fi
mkdir $source_tar_dir 2>/dev/null mkdir "$source_tar_dir" 2>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
cmd="$scpcmd:${workdirs[index]}/$source_tar_file $source_tar_dir" cmd="$scpcmd:${workdirs[index]}/$source_tar_file $source_tar_dir"
# echo "$cmd"
# $cmd
fi fi
fi fi
done done
@ -357,12 +371,12 @@ function run_thread() {
i=0 i=0
while [ $i -lt ${#hosts[*]} ]; do while [ $i -lt ${#hosts[*]} ]; do
clean_tmp $i & clean_tmp $i &
i=$(( i + 1 )) i=$((i + 1))
done done
wait wait
mkdir -p $log_dir mkdir -p "$log_dir"
rm -rf $log_dir/* rm -rf "${log_dir:?}"/*
task_file=$log_dir/$$.task task_file=$log_dir/$$.task
lock_file=$log_dir/$$.lock lock_file=$log_dir/$$.lock
index_file=$log_dir/case_index.txt index_file=$log_dir/case_index.txt
@ -370,71 +384,71 @@ stat_file=$log_dir/stat.txt
failed_case_file=$log_dir/failed.txt failed_case_file=$log_dir/failed.txt
success_case_file=$log_dir/success.txt success_case_file=$log_dir/success.txt
echo "0" >$index_file echo "0" >"$index_file"
i=0 i=0
j=0 j=0
while [ $i -lt ${#hosts[*]} ]; do while [ $i -lt ${#hosts[*]} ]; do
j=$(( j + threads[i] )) j=$((j + threads[i]))
i=$(( i + 1 )) i=$((i + 1))
done done
prepare_cases $j prepare_cases $j
i=0 i=0
while [ $i -lt ${#hosts[*]} ]; do while [ $i -lt ${#hosts[*]} ]; do
j=0 j=0
while [ $j -lt ${threads[i]} ]; do while [ $j -lt "${threads[i]}" ]; do
run_thread $i $j & run_thread $i $j &
j=$(( j + 1 )) j=$((j + 1))
done done
i=$(( i + 1 )) i=$((i + 1))
done done
wait wait
rm -f $lock_file rm -f "$lock_file"
rm -f $task_file rm -f "$task_file"
# docker ps -a|grep -v CONTAINER|awk '{print $1}'|xargs docker rm -f # docker ps -a|grep -v CONTAINER|awk '{print $1}'|xargs docker rm -f
echo "=====================================================================" echo "====================================================================="
echo "log dir: $log_dir" echo "log dir: $log_dir"
total_cases=`cat $index_file` total_cases=$(cat "$index_file")
failed_cases=0 failed_cases=0
if [ -f $failed_case_file ]; then if [ -f "$failed_case_file" ]; then
if [ ! -z "$web_server" ]; then if [ -n "$web_server" ]; then
failed_cases=`grep -v "$web_server" $failed_case_file|wc -l` failed_cases=$(grep -c -v "$web_server" "$failed_case_file")
else else
failed_cases=`grep -v "log file:" $failed_case_file|wc -l` failed_cases=$(grep -c -v "log file:" "$failed_case_file")
fi fi
fi fi
success_cases=$(( total_cases - failed_cases )) success_cases=$((total_cases - failed_cases))
echo "Total Cases: $total_cases" >$stat_file echo "Total Cases: $total_cases" >"$stat_file"
echo "Successful: $success_cases" >>$stat_file echo "Successful: $success_cases" >>"$stat_file"
echo "Failed: $failed_cases" >>$stat_file echo "Failed: $failed_cases" >>"$stat_file"
cat $stat_file cat "$stat_file"
RET=0 RET=0
i=1 i=1
if [ -f "${failed_case_file}" ]; then if [ -f "${failed_case_file}" ]; then
echo "=====================================================" echo "====================================================="
while read line; do while read -r line; do
if [ ! -z "${web_server}" ]; then if [ -n "${web_server}" ]; then
echo "$line"|grep -q "${web_server}"
if [ $? -eq 0 ]; then if echo "$line" | grep -q "${web_server}"; then
echo " $line" echo " $line"
continue continue
fi fi
else else
echo "$line"|grep -q "log file:"
if [ $? -eq 0 ]; then if echo "$line" | grep -q "log file:"; then
echo " $line" echo " $line"
continue continue
fi fi
fi fi
line=`echo "$line"|cut -d, -f 3,4,5` line=$(echo "$line" | cut -d, -f 3,4,5)
echo -e "$i. $line \e[31m failed\e[0m" >&2 echo -e "$i. $line \e[31m failed\e[0m" >&2
i=$(( i + 1 )) i=$((i + 1))
done <${failed_case_file} done <"${failed_case_file}"
RET=1 RET=1
fi fi

View File

@ -48,9 +48,9 @@ class TDSql:
self.queryCols = 0 self.queryCols = 0
self.affectedRows = 0 self.affectedRows = 0
def init(self, cursor, log=False): def init(self, cursor, log=True):
self.cursor = cursor self.cursor = cursor
print(f"sqllog is :{log}")
if (log): if (log):
caller = inspect.getframeinfo(inspect.stack()[1][0]) caller = inspect.getframeinfo(inspect.stack()[1][0])
self.cursor.log(caller.filename + ".sql") self.cursor.log(caller.filename + ".sql")

View File

@ -32,7 +32,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self._conn = conn self._conn = conn
def createDb(self, name="test", db_update_tag=0): def createDb(self, name="test", db_update_tag=0):

View File

@ -15,7 +15,7 @@ class TDTestCase:
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
self.database = "db1" self.database = "db1"
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepare_db(self): def prepare_db(self):
tdSql.execute(f"drop database if exists {self.database}") tdSql.execute(f"drop database if exists {self.database}")

View File

@ -30,7 +30,7 @@ class TDTestCase:
self.tb3 = "t3" self.tb3 = "t3"
self.once = 1000 self.once = 1000
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepare_db(self): def prepare_db(self):
tdSql.execute(f"drop database if exists {self.database}") tdSql.execute(f"drop database if exists {self.database}")

View File

@ -60,7 +60,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.taos_cfg_path = tdDnodes.dnodes[0].cfgPath self.taos_cfg_path = tdDnodes.dnodes[0].cfgPath
self.taos_data_dir = tdDnodes.dnodes[0].dataDir self.taos_data_dir = tdDnodes.dnodes[0].dataDir

View File

@ -33,7 +33,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self._conn = conn self._conn = conn
self.smlChildTableName_value = "id" self.smlChildTableName_value = "id"

View File

@ -137,7 +137,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.precision = "ms" self.precision = "ms"
self.sma_count = 0 self.sma_count = 0
self.sma_created_index = [] self.sma_created_index = []

View File

@ -17,7 +17,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.tb_nums = 10 self.tb_nums = 10
self.row_nums = 20 self.row_nums = 20
self.ts = 1434938400000 self.ts = 1434938400000

View File

@ -17,7 +17,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.tb_nums = 10 self.tb_nums = 10
self.row_nums = 20 self.row_nums = 20
self.ts = 1434938400000 self.ts = 1434938400000

View File

@ -21,7 +21,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(),False) tdSql.init(conn.cursor(),True)
self.rowNum = 10 self.rowNum = 10
self.ts = 1537146000000 self.ts = 1537146000000
self.setsql = TDSetSql() self.setsql = TDSetSql()

View File

@ -28,7 +28,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar): def init(self, conn, logSql, replicaVar):
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), logSql) tdSql.init(conn.cursor())
self.testcasePath = os.path.split(__file__)[0] self.testcasePath = os.path.split(__file__)[0]
self.testcaseFilename = os.path.split(__file__)[-1] self.testcaseFilename = os.path.split(__file__)[-1]

View File

@ -15,7 +15,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepare_datas(self, dbname="db"): def prepare_datas(self, dbname="db"):
tdSql.execute( tdSql.execute(

View File

@ -6,7 +6,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(),False) tdSql.init(conn.cursor(),True)
self.setsql = TDSetSql() self.setsql = TDSetSql()
self.rowNum = 10 self.rowNum = 10
self.ts = 1537146000000 self.ts = 1537146000000

View File

@ -14,7 +14,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepare_data(self, dbname="db"): def prepare_data(self, dbname="db"):
tdSql.execute( tdSql.execute(

View File

@ -14,7 +14,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def case1(self): def case1(self):
tdSql.execute("create database if not exists dbms precision 'ms'") tdSql.execute("create database if not exists dbms precision 'ms'")

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -14,7 +14,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.tb_nums = 10 self.tb_nums = 10
self.row_nums = 20 self.row_nums = 20
self.ts = 1434938400000 self.ts = 1434938400000

View File

@ -147,7 +147,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def __create_hsg(self, sma:Hsgschema): def __create_hsg(self, sma:Hsgschema):
return f"""{sma.histogram_flag}({sma.col}, '{sma.bin_type}', '{sma.bin_desc}', {sma.normalized})""" return f"""{sma.histogram_flag}({sma.col}, '{sma.bin_type}', '{sma.bin_desc}', {sma.normalized})"""

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d', precision: str='ms'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d', precision: str='ms'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -14,7 +14,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.tb_nums = 10 self.tb_nums = 10
self.row_nums = 20 self.row_nums = 20
self.ts = 1434938400000 self.ts = 1434938400000

View File

@ -66,7 +66,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def __query_condition(self,tbname): def __query_condition(self,tbname):
query_condition = [] query_condition = []

View File

@ -29,7 +29,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def __query_condition(self,tbname): def __query_condition(self,tbname):
query_condition = [] query_condition = []

View File

@ -16,7 +16,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def run(self): def run(self):
# tdSql.prepare() # tdSql.prepare()

View File

@ -36,7 +36,7 @@ class TDTestCase:
self.testcaseFilename = os.path.split(__file__)[-1] self.testcaseFilename = os.path.split(__file__)[-1]
# os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename)) # os.system("rm -rf %s/%s.sql" % (self.testcasePath,self.testcaseFilename))
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def run(self): def run(self):
# tdSql.prepare() # tdSql.prepare()

View File

@ -376,7 +376,7 @@ class TDTestCase:
tdSql.checkCols(1) tdSql.checkCols(1)
p = subprocess.run(["taos", '-s', "alter table test.meters drop column c2; alter table test.meters add column c1 int"]) p = subprocess.run(["taos", '-s', "alter table test.meters drop column c2; alter table test.meters add column c1 int"])
p.check_returncode() p.check_returncode()
tdSql.query_success_failed("select ts, last_row(c2), c12, ts, c12 from meters", queryTimes=10, expectErrInfo="Invalid column name: c2") tdSql.query_success_failed("select ts, last(c2), c12, ts, c12 from meters", queryTimes=10, expectErrInfo="Invalid column name: c2")
tdSql.query('select last(c1), c1, ts from meters', queryTimes=1) tdSql.query('select last(c1), c1, ts from meters', queryTimes=1)
tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.checkCols(3) tdSql.checkCols(3)
@ -413,7 +413,8 @@ class TDTestCase:
tdSql.checkCols(3) tdSql.checkCols(3)
tdSql.checkData(0, 0, None) tdSql.checkData(0, 0, None)
tdSql.checkData(0, 1, None) tdSql.checkData(0, 1, None)
tdSql.query_success_failed('select last(c2), c2, c3 from meters', queryTimes=10, expectErrInfo="Invalid column name: c2")
def run(self): def run(self):
self.prepareTestEnv() self.prepareTestEnv()

View File

@ -13,7 +13,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def initDB(self): def initDB(self):
tdSql.execute("drop database if exists db") tdSql.execute("drop database if exists db")

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1):
if dropFlag == 1: if dropFlag == 1:

View File

@ -13,7 +13,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def check_ins_cols(self): def check_ins_cols(self):
tdSql.execute("create database if not exists db") tdSql.execute("create database if not exists db")

View File

@ -27,7 +27,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -27,7 +27,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -29,7 +29,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_ctable(self,tsql=None, dbName='dbx',stbName='stb',ctbPrefix='ctb',ctbNum=1): def create_ctable(self,tsql=None, dbName='dbx',stbName='stb',ctbPrefix='ctb',ctbNum=1):
tsql.execute("use %s" %dbName) tsql.execute("use %s" %dbName)

View File

@ -20,7 +20,7 @@ class TDTestCase:
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
## add for TD-6672 ## add for TD-6672
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def insertData(self, tb_name): def insertData(self, tb_name):
insert_sql_list = [f'insert into {tb_name} values ("2021-01-01 12:00:00", 1, 1, 1, 3, 1.1, 1.1, "binary", "nchar", true, 1, 2, 3, 4)', insert_sql_list = [f'insert into {tb_name} values ("2021-01-01 12:00:00", 1, 1, 1, 3, 1.1, 1.1, "binary", "nchar", true, 1, 2, 3, 4)',

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'): def create_database(self,tsql, dbName,dropFlag=1,vgroups=2,replica=1, duration:str='1d'):
if dropFlag == 1: if dropFlag == 1:

View File

@ -32,7 +32,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(),False) tdSql.init(conn.cursor(),True)
def __substr_condition(self): # sourcery skip: extract-method def __substr_condition(self): # sourcery skip: extract-method
substr_condition = [] substr_condition = []

View File

@ -11,7 +11,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def run(self): def run(self):
"""This test case is used to verify the query performance for the merge scans process of """This test case is used to verify the query performance for the merge scans process of

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def create_ctable(self,tsql=None, dbName='db',stbName='stb',ctbPrefix='ctb',ctbNum=1): def create_ctable(self,tsql=None, dbName='db',stbName='stb',ctbPrefix='ctb',ctbNum=1):
tsql.execute("use %s" %dbName) tsql.execute("use %s" %dbName)

View File

@ -27,7 +27,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug("start to execute %s" % __file__) tdLog.debug("start to execute %s" % __file__)
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def run(self): def run(self):
dbname="db" dbname="db"

View File

@ -10,7 +10,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def test(self): def test(self):
tdLog.info(" test") tdLog.info(" test")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -26,7 +26,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -29,7 +29,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getPath(self, tool="taosBenchmark"): def getPath(self, tool="taosBenchmark"):
if (platform.system().lower() == 'windows'): if (platform.system().lower() == 'windows'):

View File

@ -16,7 +16,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.db_name = "tmq_db" self.db_name = "tmq_db"
self.topic_name = "tmq_topic" self.topic_name = "tmq_topic"

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getPath(self, tool="taosBenchmark"): def getPath(self, tool="taosBenchmark"):
if (platform.system().lower() == 'windows'): if (platform.system().lower() == 'windows'):

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
# drop some ntbs # drop some ntbs
def tmqCase1(self): def tmqCase1(self):

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
# drop some ntbs # drop some ntbs
def tmqCase1(self): def tmqCase1(self):

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getPath(self, tool="taosBenchmark"): def getPath(self, tool="taosBenchmark"):
if (platform.system().lower() == 'windows'): if (platform.system().lower() == 'windows'):

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def modifyMaxTopics(self, tmqMaxTopicNum): def modifyMaxTopics(self, tmqMaxTopicNum):
# single dnode # single dnode

View File

@ -28,7 +28,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -31,7 +31,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getPath(self, tool="taosBenchmark"): def getPath(self, tool="taosBenchmark"):
if (platform.system().lower() == 'windows'): if (platform.system().lower() == 'windows'):

View File

@ -16,7 +16,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
self.db_name = "tmq_db" self.db_name = "tmq_db"
self.topic_name = "tmq_topic" self.topic_name = "tmq_topic"

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -24,7 +24,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -28,7 +28,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -28,7 +28,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -30,7 +30,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -30,7 +30,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -32,7 +32,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -30,7 +30,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -25,7 +25,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -30,7 +30,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def getDataPath(self): def getDataPath(self):
selfPath = tdCom.getBuildPath() selfPath = tdCom.getBuildPath()

View File

@ -20,7 +20,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def case1(self): def case1(self):

View File

@ -20,7 +20,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def case1(self): def case1(self):

View File

@ -20,7 +20,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def case1(self): def case1(self):

View File

@ -23,7 +23,7 @@ class TDTestCase:
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
self.replicaVar = int(replicaVar) self.replicaVar = int(replicaVar)
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor(), False) tdSql.init(conn.cursor(), True)
def prepareTestEnv(self): def prepareTestEnv(self):
tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ") tdLog.printNoPrefix("======== prepare test env include database, stable, ctables, and insert data: ")

View File

@ -60,16 +60,16 @@ echo "ASAN_DIR : $ASAN_DIR"
# prevent delete / folder or /usr/bin # prevent delete / folder or /usr/bin
if [ ${#SIM_DIR} -lt 10 ]; then if [ ${#SIM_DIR} -lt 10 ]; then
echo "len(SIM_DIR) < 10 , danger so exit. SIM_DIR=$SIM_DIR" echo "len(SIM_DIR) < 10 , danger so exit. SIM_DIR=$SIM_DIR"
exit 1 exit 1
fi fi
rm -rf $SIM_DIR/* rm -rf "${SIM_DIR:?}"/*
mkdir -p $PRG_DIR mkdir -p $PRG_DIR
mkdir -p $ASAN_DIR mkdir -p $ASAN_DIR
cd $CODE_DIR cd "$CODE_DIR" || exit
ulimit -n 600000 ulimit -n 600000
ulimit -c unlimited ulimit -c unlimited
@ -78,10 +78,10 @@ ulimit -c unlimited
echo "ExcuteCmd:" $* echo "ExcuteCmd:" $*
if [[ "$TD_OS" == "Alpine" ]]; then if [[ "$TD_OS" == "Alpine" ]]; then
$* "$@"
else else
AsanFile=$ASAN_DIR/psim.info AsanFile=$ASAN_DIR/psim.info
echo "AsanFile:" $AsanFile echo "AsanFile:" "$AsanFile"
unset LD_PRELOAD unset LD_PRELOAD
#export LD_PRELOAD=libasan.so.5 #export LD_PRELOAD=libasan.so.5