From 6ec2bca1b8cdf4816290dff83be7b27a5ea7efd9 Mon Sep 17 00:00:00 2001 From: Shuduo Sang Date: Mon, 1 Feb 2021 17:31:05 +0800 Subject: [PATCH 01/12] [TD-2901] : fix bug taosdemo with mono compiled does not exit. --- tests/examples/C#/taosdemo/taosdemo.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/examples/C#/taosdemo/taosdemo.cs b/tests/examples/C#/taosdemo/taosdemo.cs index df52acc99d..2d78418e0a 100644 --- a/tests/examples/C#/taosdemo/taosdemo.cs +++ b/tests/examples/C#/taosdemo/taosdemo.cs @@ -650,6 +650,7 @@ namespace TDengineDriver tester.CloseConnection(); Console.WriteLine("End."); + CleanAndExitProgram(0); } public class InsertDataThread From 6d34da3964463734d015cf6eb6e2fb28fb989cb5 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 3 Feb 2021 19:05:44 +0800 Subject: [PATCH 02/12] [TD-2493]fix email error --- Jenkinsfile | 34 ++++++++++++++++++++++++++-------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 536cbe73a2..0d13a21212 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -31,6 +31,7 @@ def abort_previous(){ if (buildNumber > 1) milestone(buildNumber - 1) milestone(buildNumber) } +def kipstage=0 def pre_test(){ catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') { sh ''' @@ -72,12 +73,29 @@ pipeline { } stages { - + stage('pre_build'){ + agent{label 'master'} + steps { + sh''' + cd ${WORKSPACE} + git checkout develop + git pull + git fetch origin +refs/pull/${CHANGE_ID}/merge + git checkout -qf FETCH_HEAD + ''' + script{ + skipstage=sh(script:"git --no-pager diff --name-only FETCH_HEAD develop|grep -v -E '.*md|//src//connector|Jenkinsfile|test-all.sh' || echo 1 ",returnStdout:true) + } + } + } stage('Parallel test stage') { //only build pr when { changeRequest() + expression { + skipstage == 0 + } } parallel { stage('python_1_s1') { @@ -127,7 +145,7 @@ pipeline { stage('test_b1_s2') { agent{label 'b1'} steps { - timeout(time: 90, unit: 'MINUTES'){ + timeout(time: 45, unit: 'MINUTES'){ pre_test() sh ''' cd ${WKC}/tests @@ -245,7 +263,7 @@ pipeline { success { emailext ( subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: ''' + body: """ @@ -261,7 +279,7 @@ pipeline {
    -
  • 构建名称>>分支:${PROJECT_NAME}
  • +
  • 构建名称>>分支:${env.CHANGE_BRANCK}
  • 构建结果: Successful
  • 构建编号:${BUILD_NUMBER}
  • 触发用户:${CAUSE}
  • @@ -275,7 +293,7 @@ pipeline { - ''', + """, to: "${env.CHANGE_AUTHOR_EMAIL}", from: "support@taosdata.com" ) @@ -283,7 +301,7 @@ pipeline { failure { emailext ( subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", - body: ''' + body: """ @@ -299,7 +317,7 @@ pipeline {
      -
    • 构建名称>>分支:${PROJECT_NAME}
    • +
    • 构建名称>>分支:${env.CHANGE_BRANCK}
    • 构建结果: Successful
    • 构建编号:${BUILD_NUMBER}
    • 触发用户:${CAUSE}
    • @@ -313,7 +331,7 @@ pipeline { - ''', + """, to: "${env.CHANGE_AUTHOR_EMAIL}", from: "support@taosdata.com" ) From 977695c64db4c2db8a9f2313e7bdffd59c4ad374 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 3 Feb 2021 19:10:07 +0800 Subject: [PATCH 03/12] fix error --- Jenkinsfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 0d13a21212..bcd9882ec8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -282,7 +282,7 @@ pipeline {
    • 构建名称>>分支:${env.CHANGE_BRANCK}
    • 构建结果: Successful
    • 构建编号:${BUILD_NUMBER}
    • -
    • 触发用户:${CAUSE}
    • +
    • 触发用户:${env.CHANGE_AUTHOR}
    • 提交信息:${CHANGE_TITLE}
    • 构建地址:${BUILD_URL}
    • 构建日志:${BUILD_URL}console
    • @@ -320,7 +320,7 @@ pipeline {
    • 构建名称>>分支:${env.CHANGE_BRANCK}
    • 构建结果: Successful
    • 构建编号:${BUILD_NUMBER}
    • -
    • 触发用户:${CAUSE}
    • +
    • 触发用户:${env.CHANGE_AUTHOR}
    • 提交信息:${CHANGE_TITLE}
    • 构建地址:${BUILD_URL}
    • 构建日志:${BUILD_URL}console
    • From 75acf33d6966bdadcf6f66fda042d59c0b93839f Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 3 Feb 2021 19:22:51 +0800 Subject: [PATCH 04/12] fix error --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index bcd9882ec8..bd56309dd2 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -262,7 +262,7 @@ pipeline { success { emailext ( - subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' SUCCESS", body: """ @@ -279,14 +279,14 @@ pipeline {
        -
      • 构建名称>>分支:${env.CHANGE_BRANCK}
      • +
      • 构建名称>>分支:${env.BRANCH_NAME}
      • 构建结果: Successful
      • 构建编号:${BUILD_NUMBER}
      • 触发用户:${env.CHANGE_AUTHOR}
      • 提交信息:${CHANGE_TITLE}
      • 构建地址:${BUILD_URL}
      • 构建日志:${BUILD_URL}console
      • -
      • 变更集:${JELLY_SCRIPT}
      • +
      @@ -300,7 +300,7 @@ pipeline { } failure { emailext ( - subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'", + subject: "PR-result: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]' FAIL", body: """ @@ -317,14 +317,14 @@ pipeline {
        -
      • 构建名称>>分支:${env.CHANGE_BRANCK}
      • +
      • 构建名称>>分支:${env.BRANCH_NAME}
      • 构建结果: Successful
      • 构建编号:${BUILD_NUMBER}
      • 触发用户:${env.CHANGE_AUTHOR}
      • 提交信息:${CHANGE_TITLE}
      • 构建地址:${BUILD_URL}
      • 构建日志:${BUILD_URL}console
      • -
      • 变更集:${JELLY_SCRIPT}
      • +
      From 14ecff2749d1331c8b0895bc4790cff469f6b869 Mon Sep 17 00:00:00 2001 From: liuyq-617 Date: Wed, 3 Feb 2021 19:34:25 +0800 Subject: [PATCH 05/12] [TD-2555]add test for stddev --- tests/pytest/pytest_3.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/pytest/pytest_3.sh b/tests/pytest/pytest_3.sh index 5e59bb879b..8b2ac721e3 100755 --- a/tests/pytest/pytest_3.sh +++ b/tests/pytest/pytest_3.sh @@ -89,6 +89,7 @@ python3 ./test.py -f functions/function_sum.py -r 1 python3 ./test.py -f functions/function_top.py -r 1 python3 ./test.py -f functions/function_twa.py -r 1 python3 ./test.py -f functions/function_twa_test2.py +python3 ./test.py -f functions/function_stddev_td2555.py python3 queryCount.py python3 ./test.py -f query/queryGroupbyWithInterval.py python3 client/twoClients.py From 01e47002ea407d49646f43d73a320c59026582b4 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 4 Feb 2021 10:29:30 +0800 Subject: [PATCH 06/12] Fix taosdemoTest2.py failure --- tests/pytest/tools/taosdemoTest2.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/pytest/tools/taosdemoTest2.py b/tests/pytest/tools/taosdemoTest2.py index 4d7e871e66..daaf83b869 100644 --- a/tests/pytest/tools/taosdemoTest2.py +++ b/tests/pytest/tools/taosdemoTest2.py @@ -34,7 +34,12 @@ class TDTestCase: os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords)) if(threadID == 1): print("use test") - tdSql.execute("use test") + tdSql.execute("use test") + while True: + tdSql.query("show tables") + rows = tdSql.queryRows + if(rows == 10): + break while True: print("query started") tdSql.query("select * from test.t9") @@ -54,8 +59,7 @@ class TDTestCase: t1 = threading.Thread(target=self.insertDataAndAlterTable, args=(0, )) t2 = threading.Thread(target=self.insertDataAndAlterTable, args=(1, )) - t1.start() - time.sleep(2) + t1.start() t2.start() t1.join() t2.join() From 86c2c8f871b78c5418633f0fdc578c3f0640b5ff Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 4 Feb 2021 10:58:11 +0800 Subject: [PATCH 07/12] Fix taosdemotest2.py failure --- tests/pytest/tools/taosdemoTest2.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/tests/pytest/tools/taosdemoTest2.py b/tests/pytest/tools/taosdemoTest2.py index daaf83b869..1e492aa8fc 100644 --- a/tests/pytest/tools/taosdemoTest2.py +++ b/tests/pytest/tools/taosdemoTest2.py @@ -33,18 +33,23 @@ class TDTestCase: if(threadID == 0): os.system("yes | taosdemo -t %d -n %d -x" % (self.numberOfTables, self.numberOfRecords)) if(threadID == 1): + time.sleep(2) print("use test") tdSql.execute("use test") + # check if all the tables have heen created while True: tdSql.query("show tables") rows = tdSql.queryRows - if(rows == 10): - break + print("number of tables: %d" % rows) + if(rows == self.numberOfTables): + break + time.sleep(1) + # check if there are any records in the last created table while True: print("query started") tdSql.query("select * from test.t9") rows = tdSql.queryRows - print("rows %d" % rows) + print("number of records: %d" % rows) if(rows > 0): break time.sleep(1) From b788f3d8e4bbd2366020f816a2606842559bc200 Mon Sep 17 00:00:00 2001 From: Ping Xiao Date: Thu, 4 Feb 2021 11:51:28 +0800 Subject: [PATCH 08/12] [TD-1351]: add test case --- tests/pytest/query/queryGroupbySort.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/pytest/query/queryGroupbySort.py b/tests/pytest/query/queryGroupbySort.py index 80f6d55aae..c2649a86db 100644 --- a/tests/pytest/query/queryGroupbySort.py +++ b/tests/pytest/query/queryGroupbySort.py @@ -45,6 +45,10 @@ class TDTestCase: tdSql.checkData(0, 0, "2018-10-03 14:38:05") tdSql.checkData(1, 0, "2018-10-03 14:38:15") tdSql.checkData(2, 0, "2018-10-03 14:38:16") + + tdSql.error("SELECT SUM(current) as s, AVG(voltage) FROM meters WHERE groupId > 1 INTERVAL(1s) GROUP BY location order by s ASC") + + tdSql.error("SELECT SUM(current) as s, AVG(voltage) FROM meters WHERE groupId > 1 INTERVAL(1s) GROUP BY location order by s DESC") def stop(self): tdSql.close() From b449c06936a1ea2b94d8f3b0988d0ccfa3042f1a Mon Sep 17 00:00:00 2001 From: haojun Liao Date: Thu, 4 Feb 2021 12:54:52 +0800 Subject: [PATCH 09/12] [TD-2927] [TD-2927]: fix the bug found in the regression test. --- src/tsdb/src/tsdbRead.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbRead.c b/src/tsdb/src/tsdbRead.c index cd421032cd..b16337ed7a 100644 --- a/src/tsdb/src/tsdbRead.c +++ b/src/tsdb/src/tsdbRead.c @@ -1180,9 +1180,12 @@ static void copyOneRowFromMem(STsdbQueryHandle* pQueryHandle, int32_t capacity, char* pData = NULL; // the schema version info is embeded in SDataRow - int32_t numOfRowCols = schemaNCols(pSchema); + int32_t numOfRowCols = 0; if (pSchema == NULL) { pSchema = tsdbGetTableSchemaByVersion(pTable, dataRowVersion(row)); + numOfRowCols = schemaNCols(pSchema); + } else { + numOfRowCols = schemaNCols(pSchema); } int32_t i = 0, j = 0; From 5584f4f915ba9da43af37c3e90a9c25b01be6ebd Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 4 Feb 2021 15:04:18 +0800 Subject: [PATCH 10/12] [TD-2925]: rename keep2,keep1 -> keep1,keep0 --- src/inc/taoserror.h | 2 +- src/kit/taosdemox/taosdemox.c | 2 +- src/mnode/src/mnodeDb.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/inc/taoserror.h b/src/inc/taoserror.h index 429304c744..92493faea8 100644 --- a/src/inc/taoserror.h +++ b/src/inc/taoserror.h @@ -192,7 +192,7 @@ TAOS_DEFINE_ERROR(TSDB_CODE_MND_DB_IN_DROPPING, 0, 0x0386, "Database n TAOS_DEFINE_ERROR(TSDB_CODE_MND_VGROUP_NOT_READY, 0, 0x0387, "Database unsynced") TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_OPTION_DAYS, 0, 0x0390, "Invalid database option: days out of range") -TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_OPTION_KEEP, 0, 0x0391, "Invalid database option: keep >= keep2 >= keep1 >= days") +TAOS_DEFINE_ERROR(TSDB_CODE_MND_INVALID_DB_OPTION_KEEP, 0, 0x0391, "Invalid database option: keep >= keep1 >= keep0 >= days") // dnode TAOS_DEFINE_ERROR(TSDB_CODE_DND_MSG_NOT_PROCESSED, 0, 0x0400, "Message not processed") diff --git a/src/kit/taosdemox/taosdemox.c b/src/kit/taosdemox/taosdemox.c index 40ca232327..3337546ee8 100644 --- a/src/kit/taosdemox/taosdemox.c +++ b/src/kit/taosdemox/taosdemox.c @@ -1380,7 +1380,7 @@ static void printfDbInfoForQueryToFile(char* filename, SDbInfo* dbInfos, int ind fprintf(fp, "replica: %d\n", dbInfos->replica); fprintf(fp, "quorum: %d\n", dbInfos->quorum); fprintf(fp, "days: %d\n", dbInfos->days); - fprintf(fp, "keep1,keep2,keep(D): %s\n", dbInfos->keeplist); + fprintf(fp, "keep0,keep1,keep(D): %s\n", dbInfos->keeplist); fprintf(fp, "cache(MB): %d\n", dbInfos->cache); fprintf(fp, "blocks: %d\n", dbInfos->blocks); fprintf(fp, "minrows: %d\n", dbInfos->minrows); diff --git a/src/mnode/src/mnodeDb.c b/src/mnode/src/mnodeDb.c index dbb5f56692..9fdbaa7965 100644 --- a/src/mnode/src/mnodeDb.c +++ b/src/mnode/src/mnodeDb.c @@ -568,7 +568,7 @@ static int32_t mnodeGetDbMeta(STableMetaMsg *pMeta, SShowObj *pShow, void *pConn pShow->bytes[cols] = 24 + VARSTR_HEADER_SIZE; pSchema[cols].type = TSDB_DATA_TYPE_BINARY; - strcpy(pSchema[cols].name, "keep1,keep2,keep(D)"); + strcpy(pSchema[cols].name, "keep0,keep1,keep(D)"); pSchema[cols].bytes = htons(pShow->bytes[cols]); cols++; From 64aad9683daf07ca8868ecce866c681e5e4bb663 Mon Sep 17 00:00:00 2001 From: Shengliang Guan Date: Thu, 4 Feb 2021 15:19:57 +0800 Subject: [PATCH 11/12] fix crash while run m2.sim --- src/tsdb/src/tsdbSync.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tsdb/src/tsdbSync.c b/src/tsdb/src/tsdbSync.c index 88ab973f5e..6b8483e4a6 100644 --- a/src/tsdb/src/tsdbSync.c +++ b/src/tsdb/src/tsdbSync.c @@ -549,7 +549,7 @@ static int32_t tsdbSyncSendDFileSet(SSyncH *pSynch, SDFileSet *pSet) { bool toSend = false; if (tsdbSendDFileSetInfo(pSynch, pSet) < 0) { - tsdbError("vgId:%d, failed to send fileset:%d info since %s", REPO_ID(pRepo), pSet->fid, tstrerror(terrno)); + tsdbError("vgId:%d, failed to send fileset:%d info since %s", REPO_ID(pRepo), pSet ? pSet->fid : -1, tstrerror(terrno)); return -1; } From cc29da4e52e47cb216d9e87b5ca3b6fb291ec142 Mon Sep 17 00:00:00 2001 From: Minglei Jin Date: Thu, 4 Feb 2021 15:40:51 +0800 Subject: [PATCH 12/12] [TD-2643,TD-2925]: update sim test case and JDBCDemo doc --- tests/examples/JDBC/JDBCDemo/README-jdbc-windows.md | 2 +- tests/script/general/http/restful_full.sim | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/examples/JDBC/JDBCDemo/README-jdbc-windows.md b/tests/examples/JDBC/JDBCDemo/README-jdbc-windows.md index e14a5f7b67..17c5c8df00 100644 --- a/tests/examples/JDBC/JDBCDemo/README-jdbc-windows.md +++ b/tests/examples/JDBC/JDBCDemo/README-jdbc-windows.md @@ -137,7 +137,7 @@ Welcome to the TDengine shell from Linux, Client Version:2.0.1.1 Copyright (c) 2017 by TAOS Data, Inc. All rights reserved. taos> show databases; - name | created_time | ntables | vgroups | replica | quorum | days | keep1,keep2,keep(D) | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | precision | status | + name | created_time | ntables | vgroups | replica | quorum | days | keep0,keep1,keep(D) | cache(MB) | blocks | minrows | maxrows | wallevel | fsync | comp | precision | status | =================================================================================================================================================================================================================================================================== test | 2020-08-19 18:43:50.731 | 1 | 1 | 1 | 1 | 2 | 3650,3650,3650 | 16 | 6 | 100 | 4096 | 1 | 3000 | 2 | ms | ready | log | 2020-08-19 18:40:28.064 | 4 | 1 | 1 | 1 | 10 | 30,30,30 | 1 | 3 | 100 | 4096 | 1 | 3000 | 2 | us | ready | diff --git a/tests/script/general/http/restful_full.sim b/tests/script/general/http/restful_full.sim index 17ee0ea232..05f6a9ac9c 100644 --- a/tests/script/general/http/restful_full.sim +++ b/tests/script/general/http/restful_full.sim @@ -88,7 +88,7 @@ print =============== step2 - no db #11 system_content curl -H 'Authorization: Taosd /KfeAzX/f9na8qdtNZmtONryp201ma04bEl8LcvLUd7a8qdtNZmtONryp201ma04' -d 'show databases' 127.0.0.1:7111/rest/sql print 11-> $system_content -if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep1,keep2,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"data":[],"rows":0}@ then +if $system_content != @{"status":"succ","head":["name","created_time","ntables","vgroups","replica","quorum","days","keep0,keep1,keep(D)","cache(MB)","blocks","minrows","maxrows","wallevel","fsync","comp","cachelast","precision","update","status"],"data":[],"rows":0}@ then return -1 endi