提交 049789b5 编写于 作者: A Alex Duan

Merge branch '2.4' into fix/TS-802-V24

...@@ -8,6 +8,7 @@ def skipbuild = 0 ...@@ -8,6 +8,7 @@ def skipbuild = 0
def win_stop = 0 def win_stop = 0
def scope = [] def scope = []
def mod = [0,1,2,3,4] def mod = [0,1,2,3,4]
def sim_mod = [0,1,2,3]
def abortPreviousBuilds() { def abortPreviousBuilds() {
def currentJobName = env.JOB_NAME def currentJobName = env.JOB_NAME
...@@ -54,10 +55,10 @@ def pre_test(){ ...@@ -54,10 +55,10 @@ def pre_test(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WKC} cd ${WKC}
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -86,10 +87,10 @@ def pre_test(){ ...@@ -86,10 +87,10 @@ def pre_test(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WK} cd ${WK}
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -129,10 +130,10 @@ def pre_test_noinstall(){ ...@@ -129,10 +130,10 @@ def pre_test_noinstall(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WKC} cd ${WKC}
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -161,10 +162,10 @@ def pre_test_noinstall(){ ...@@ -161,10 +162,10 @@ def pre_test_noinstall(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WK} cd ${WK}
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -201,10 +202,10 @@ def pre_test_mac(){ ...@@ -201,10 +202,10 @@ def pre_test_mac(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WKC} cd ${WKC}
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -233,10 +234,10 @@ def pre_test_mac(){ ...@@ -233,10 +234,10 @@ def pre_test_mac(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
sh ''' sh '''
cd ${WK} cd ${WK}
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -279,10 +280,10 @@ def pre_test_win(){ ...@@ -279,10 +280,10 @@ def pre_test_win(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
bat ''' bat '''
cd C:\\workspace\\TDinternal\\community cd C:\\workspace\\TDinternal\\community
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -310,10 +311,10 @@ def pre_test_win(){ ...@@ -310,10 +311,10 @@ def pre_test_win(){
git checkout master git checkout master
''' '''
} }
else if(env.CHANGE_TARGET == '2.4'){ else if(env.CHANGE_TARGET == '2.0'){
bat ''' bat '''
cd C:\\workspace\\TDinternal cd C:\\workspace\\TDinternal
git checkout 2.4 git checkout 2.0
''' '''
} }
else{ else{
...@@ -382,7 +383,9 @@ pipeline { ...@@ -382,7 +383,9 @@ pipeline {
temp = (gitlog =~ /\((.*?)\)/) temp = (gitlog =~ /\((.*?)\)/)
temp = temp[0].remove(1) temp = temp[0].remove(1)
scope = temp.split(",") scope = temp.split(",")
scope = ['connector','query','insert','other','tools','taosAdapter']
Collections.shuffle mod Collections.shuffle mod
Collections.shuffle sim_mod
} }
} }
...@@ -400,10 +403,10 @@ pipeline { ...@@ -400,10 +403,10 @@ pipeline {
} }
parallel { parallel {
stage('python_1') { stage('python_1') {
agent{label " slave1 || slave6 || slave11 || slave16 "} agent{label " slave1 || slave11 "}
steps { steps {
pre_test() pre_test()
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 100, unit: 'MINUTES'){
script{ script{
scope.each { scope.each {
sh """ sh """
...@@ -417,10 +420,10 @@ pipeline { ...@@ -417,10 +420,10 @@ pipeline {
} }
} }
stage('python_2') { stage('python_2') {
agent{label " slave2 || slave7 || slave12 || slave17 "} agent{label " slave2 || slave12 "}
steps { steps {
pre_test() pre_test()
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 100, unit: 'MINUTES'){
script{ script{
scope.each { scope.each {
sh """ sh """
...@@ -434,7 +437,7 @@ pipeline { ...@@ -434,7 +437,7 @@ pipeline {
} }
} }
stage('python_3') { stage('python_3') {
agent{label " slave3 || slave8 || slave13 ||slave18 "} agent{label " slave3 || slave13 "}
steps { steps {
timeout(time: 105, unit: 'MINUTES'){ timeout(time: 105, unit: 'MINUTES'){
pre_test() pre_test()
...@@ -451,9 +454,9 @@ pipeline { ...@@ -451,9 +454,9 @@ pipeline {
} }
} }
stage('python_4') { stage('python_4') {
agent{label " slave4 || slave9 || slave14 || slave19 "} agent{label " slave4 || slave14 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 100, unit: 'MINUTES'){
pre_test() pre_test()
script{ script{
scope.each { scope.each {
...@@ -469,9 +472,9 @@ pipeline { ...@@ -469,9 +472,9 @@ pipeline {
} }
} }
stage('python_5') { stage('python_5') {
agent{label " slave5 || slave10 || slave15 || slave20 "} agent{label " slave5 || slave15 "}
steps { steps {
timeout(time: 55, unit: 'MINUTES'){ timeout(time: 100, unit: 'MINUTES'){
pre_test() pre_test()
script{ script{
scope.each { scope.each {
...@@ -486,35 +489,98 @@ pipeline { ...@@ -486,35 +489,98 @@ pipeline {
} }
} }
} }
stage('arm64centos7') { stage('sim_1') {
agent{label " arm64centos7 "} agent{label " slave6 || slave16 "}
steps { steps {
pre_test_noinstall() pre_test()
} timeout(time: 100, unit: 'MINUTES'){
sh """
date
cd ${WKC}/tests
./test-CI.sh sim 4 ${sim_mod[0]}
date"""
}
}
} }
stage('arm64centos8') { stage('sim_2') {
agent{label " arm64centos8 "} agent{label " slave7 || slave17 "}
steps { steps {
pre_test_noinstall() pre_test()
timeout(time: 100, unit: 'MINUTES'){
sh """
date
cd ${WKC}/tests
./test-CI.sh sim 4 ${sim_mod[1]}
date"""
} }
}
} }
stage('arm32bionic') { stage('sim_3') {
agent{label " arm32bionic "} agent{label " slave8 || slave18 "}
steps { steps {
pre_test_noinstall() timeout(time: 105, unit: 'MINUTES'){
pre_test()
sh """
date
cd ${WKC}/tests
./test-CI.sh sim 4 ${sim_mod[2]}
date"""
} }
}
} }
stage('arm64bionic') { stage('sim_4') {
agent{label " arm64bionic "} agent{label " slave9 || slave19 "}
steps { steps {
pre_test_noinstall() timeout(time: 100, unit: 'MINUTES'){
pre_test()
sh """
date
cd ${WKC}/tests
./test-CI.sh sim 4 ${sim_mod[3]}
date"""
}
} }
} }
stage('arm64focal') { stage('other') {
agent{label " arm64focal "} agent{label " slave10 || slave20 "}
steps { steps {
pre_test_noinstall() timeout(time: 100, unit: 'MINUTES'){
pre_test()
timeout(time: 60, unit: 'MINUTES'){
sh '''
cd ${WKC}/tests/pytest
./crash_gen.sh -a -p -t 4 -s 2000
'''
}
timeout(time: 60, unit: 'MINUTES'){
sh '''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_crash_gen_val_log.sh
'''
sh '''
cd ${WKC}/tests/pytest
rm -rf /var/lib/taos/*
rm -rf /var/log/taos/*
./handle_taosd_val_log.sh
'''
}
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh '''
cd ${WKC}/tests/pytest
./valgrind-test.sh 2>&1 > mem-error-out.log
./handle_val_log.sh
'''
}
sh '''
cd ${WKC}/tests
./test-all.sh full unit
date
'''
} }
}
} }
stage('centos7') { stage('centos7') {
agent{label " centos7 "} agent{label " centos7 "}
...@@ -546,12 +612,41 @@ pipeline { ...@@ -546,12 +612,41 @@ pipeline {
pre_test_mac() pre_test_mac()
} }
} }
stage('arm64centos7') {
agent{label " arm64centos7 "}
steps {
pre_test_noinstall()
}
}
stage('arm64centos8') {
agent{label " arm64centos8 "}
steps {
pre_test_noinstall()
}
}
stage('arm32bionic') {
agent{label " arm32bionic "}
steps {
pre_test_noinstall()
}
}
stage('arm64bionic') {
agent{label " arm64bionic "}
steps {
pre_test_noinstall()
}
}
stage('arm64focal') {
agent{label " arm64focal "}
steps {
pre_test_noinstall()
}
}
stage('build'){ stage('build'){
agent{label " wintest "} agent{label " wintest "}
steps { steps {
pre_test() pre_test()
script{ script{
while(win_stop == 0){ while(win_stop == 0){
sleep(1) sleep(1)
} }
...@@ -561,6 +656,7 @@ pipeline { ...@@ -561,6 +656,7 @@ pipeline {
stage('test'){ stage('test'){
agent{label "win"} agent{label "win"}
steps{ steps{
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') { catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
pre_test_win() pre_test_win()
timeout(time: 20, unit: 'MINUTES'){ timeout(time: 20, unit: 'MINUTES'){
...@@ -569,7 +665,7 @@ pipeline { ...@@ -569,7 +665,7 @@ pipeline {
.\\test-all.bat wintest .\\test-all.bat wintest
''' '''
} }
} }
script{ script{
win_stop=1 win_stop=1
} }
......
...@@ -902,7 +902,7 @@ SSDataBlock* doGlobalAggregate(void* param, bool* newgroup) { ...@@ -902,7 +902,7 @@ SSDataBlock* doGlobalAggregate(void* param, bool* newgroup) {
// not belongs to the same group, return the result of current group; // not belongs to the same group, return the result of current group;
setInputDataBlock(pOperator, pAggInfo->binfo.pCtx, pAggInfo->pExistBlock, TSDB_ORDER_ASC); setInputDataBlock(pOperator, pAggInfo->binfo.pCtx, pAggInfo->pExistBlock, TSDB_ORDER_ASC);
updateOutputBuf(&pAggInfo->binfo, &pAggInfo->bufCapacity, pAggInfo->pExistBlock->info.rows); updateOutputBuf(&pAggInfo->binfo, &pAggInfo->bufCapacity, pAggInfo->pExistBlock->info.rows, pOperator->pRuntimeEnv);
{ // reset output buffer { // reset output buffer
for(int32_t j = 0; j < pOperator->numOfOutput; ++j) { for(int32_t j = 0; j < pOperator->numOfOutput; ++j) {
...@@ -954,7 +954,7 @@ SSDataBlock* doGlobalAggregate(void* param, bool* newgroup) { ...@@ -954,7 +954,7 @@ SSDataBlock* doGlobalAggregate(void* param, bool* newgroup) {
// not belongs to the same group, return the result of current group // not belongs to the same group, return the result of current group
setInputDataBlock(pOperator, pAggInfo->binfo.pCtx, pBlock, TSDB_ORDER_ASC); setInputDataBlock(pOperator, pAggInfo->binfo.pCtx, pBlock, TSDB_ORDER_ASC);
updateOutputBuf(&pAggInfo->binfo, &pAggInfo->bufCapacity, pBlock->info.rows * pAggInfo->resultRowFactor); updateOutputBuf(&pAggInfo->binfo, &pAggInfo->bufCapacity, pBlock->info.rows * pAggInfo->resultRowFactor, pOperator->pRuntimeEnv);
doExecuteFinalMerge(pOperator, pOperator->numOfOutput, pBlock); doExecuteFinalMerge(pOperator, pOperator->numOfOutput, pBlock);
savePrevOrderColumns(pAggInfo->currentGroupColData, pAggInfo->groupColumnList, pBlock, 0, &pAggInfo->hasGroupColData); savePrevOrderColumns(pAggInfo->currentGroupColData, pAggInfo->groupColumnList, pBlock, 0, &pAggInfo->hasGroupColData);
......
...@@ -1866,6 +1866,7 @@ int tscProcessRetrieveGlobalMergeRsp(SSqlObj *pSql) { ...@@ -1866,6 +1866,7 @@ int tscProcessRetrieveGlobalMergeRsp(SSqlObj *pSql) {
bool convertJson = true; bool convertJson = true;
if (pQueryInfo->isStddev == true) convertJson = false; if (pQueryInfo->isStddev == true) convertJson = false;
convertQueryResult(pRes, pQueryInfo, pSql->self, true, convertJson); convertQueryResult(pRes, pQueryInfo, pSql->self, true, convertJson);
pRes->code = pQueryInfo->pQInfo->code;
code = pRes->code; code = pRes->code;
if (pRes->code == TSDB_CODE_SUCCESS) { if (pRes->code == TSDB_CODE_SUCCESS) {
......
Subproject commit dd78bfff5549c08153798719c1707ab441b5f4ab Subproject commit 59f00a69f36b08cea86a70a22c29b2c27ef506ae
...@@ -171,7 +171,6 @@ static void monSaveSystemInfo(); ...@@ -171,7 +171,6 @@ static void monSaveSystemInfo();
static void monSaveClusterInfo(); static void monSaveClusterInfo();
static void monSaveDnodesInfo(); static void monSaveDnodesInfo();
static void monSaveVgroupsInfo(); static void monSaveVgroupsInfo();
static void monSaveSlowQueryInfo();
static void monSaveDisksInfo(); static void monSaveDisksInfo();
static void monSaveGrantsInfo(); static void monSaveGrantsInfo();
static void monSaveHttpReqInfo(); static void monSaveHttpReqInfo();
...@@ -321,7 +320,6 @@ static void *monThreadFunc(void *param) { ...@@ -321,7 +320,6 @@ static void *monThreadFunc(void *param) {
monSaveClusterInfo(); monSaveClusterInfo();
} }
monSaveVgroupsInfo(); monSaveVgroupsInfo();
monSaveSlowQueryInfo();
monSaveDisksInfo(); monSaveDisksInfo();
monSaveGrantsInfo(); monSaveGrantsInfo();
monSaveHttpReqInfo(); monSaveHttpReqInfo();
...@@ -383,9 +381,9 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) { ...@@ -383,9 +381,9 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
tsMonitorDbName, TSDB_DEFAULT_USER); tsMonitorDbName, TSDB_DEFAULT_USER);
} else if (cmd == MON_CMD_CREATE_TB_SLOWQUERY) { } else if (cmd == MON_CMD_CREATE_TB_SLOWQUERY) {
snprintf(sql, SQL_LENGTH, snprintf(sql, SQL_LENGTH,
"create table if not exists %s.slowquery(ts timestamp, query_id " "create table if not exists %s.slowquery(ts timestamp, username "
"binary(%d), username binary(%d), qid binary(%d), created_time timestamp, time bigint, end_point binary(%d), sql binary(%d))", "binary(%d), created_time timestamp, time bigint, sql binary(%d))",
tsMonitorDbName, QUERY_ID_LEN, TSDB_TABLE_FNAME_LEN - 1, QUERY_ID_LEN, TSDB_EP_LEN, TSDB_SLOW_QUERY_SQL_LEN); tsMonitorDbName, TSDB_TABLE_FNAME_LEN - 1, TSDB_SLOW_QUERY_SQL_LEN);
} else if (cmd == MON_CMD_CREATE_TB_LOG) { } else if (cmd == MON_CMD_CREATE_TB_LOG) {
snprintf(sql, SQL_LENGTH, snprintf(sql, SQL_LENGTH,
"create table if not exists %s.log(ts timestamp, level tinyint, " "create table if not exists %s.log(ts timestamp, level tinyint, "
...@@ -1213,91 +1211,6 @@ static void monSaveVgroupsInfo() { ...@@ -1213,91 +1211,6 @@ static void monSaveVgroupsInfo() {
taos_free_result(result); taos_free_result(result);
} }
static void monSaveSlowQueryInfo() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
int32_t pos = snprintf(sql, SQL_LENGTH, "insert into %s.slowquery values(%" PRId64, tsMonitorDbName, ts);
bool has_slowquery = false;
TAOS_RES *result = taos_query(tsMonitor.conn, "show queries");
int32_t code = taos_errno(result);
if (code != TSDB_CODE_SUCCESS) {
monError("failed to execute cmd: show queries, reason:%s", tstrerror(code));
}
TAOS_ROW row;
int32_t num_fields = taos_num_fields(result);
TAOS_FIELD *fields = taos_fetch_fields(result);
int32_t charLen;
while ((row = taos_fetch_row(result))) {
for (int i = 0; i < num_fields; ++i) {
if (strcmp(fields[i].name, "query_id") == 0) {
has_slowquery = true;
charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (charLen < 0) {
monError("failed to save slow_query info, reason: invalid row %s len, sql:%s", (char *)row[i], tsMonitor.sql);
goto DONE;
}
pos += snprintf(sql + pos, strlen(SQL_STR_FMT) + charLen + 1, ", "SQL_STR_FMT, (char *)row[i]);
} else if (strcmp(fields[i].name, "user") == 0) {
charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (charLen < 0) {
monError("failed to save slow_query info, reason: invalid row %s len, sql:%s", (char *)row[i], tsMonitor.sql);
goto DONE;
}
pos += snprintf(sql + pos, strlen(SQL_STR_FMT) + charLen + 1, ", "SQL_STR_FMT, (char *)row[i]);
} else if (strcmp(fields[i].name, "qid") == 0) {
charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (charLen < 0) {
monError("failed to save slow_query info, reason: invalid row %s len, sql:%s", (char *)row[i], tsMonitor.sql);
goto DONE;
}
pos += snprintf(sql + pos, strlen(SQL_STR_FMT) + charLen + 1, ", "SQL_STR_FMT, (char *)row[i]);
} else if (strcmp(fields[i].name, "created_time") == 0) {
int64_t create_time = *(int64_t *)row[i];
create_time = convertTimePrecision(create_time, TSDB_TIME_PRECISION_MILLI, TSDB_TIME_PRECISION_MICRO);
pos += snprintf(sql + pos, SQL_LENGTH, ", %" PRId64 "", create_time);
} else if (strcmp(fields[i].name, "time") == 0) {
pos += snprintf(sql + pos, SQL_LENGTH, ", %" PRId64 "", *(int64_t *)row[i]);
} else if (strcmp(fields[i].name, "ep") == 0) {
charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (charLen < 0) {
monError("failed to save slow_query info, reason: invalid row %s len, sql:%s", (char *)row[i], tsMonitor.sql);
goto DONE;
}
pos += snprintf(sql + pos, strlen(SQL_STR_FMT) + charLen + 1, ", "SQL_STR_FMT, (char *)row[i]);
} else if (strcmp(fields[i].name, "sql") == 0) {
charLen = monGetRowElemCharLen(fields[i], (char *)row[i]);
if (charLen < 0) {
monError("failed to save slow_query info, reason: invalid row %s len, sql:%s", (char *)row[i], tsMonitor.sql);
goto DONE;
}
pos += snprintf(sql + pos, strlen(SQL_STR_FMT) + charLen + 2, ", "SQL_STR_FMT")", (char *)row[i]);
}
}
}
monDebug("save slow query, sql:%s", sql);
if (!has_slowquery) {
goto DONE;
}
void *res = taos_query(tsMonitor.conn, tsMonitor.sql);
code = taos_errno(res);
taos_free_result(res);
if (code != 0) {
monError("failed to save slowquery info, reason:%s, sql:%s", tstrerror(code), tsMonitor.sql);
} else {
monIncSubmitReqCnt();
monDebug("successfully to save slowquery info, sql:%s", tsMonitor.sql);
}
DONE:
taos_free_result(result);
return;
}
static void monSaveDisksInfo() { static void monSaveDisksInfo() {
int64_t ts = taosGetTimestampUs(); int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql; char * sql = tsMonitor.sql;
......
...@@ -659,7 +659,7 @@ void* doDestroyFilterInfo(SSingleColumnFilterInfo* pFilterInfo, int32_t numOfFil ...@@ -659,7 +659,7 @@ void* doDestroyFilterInfo(SSingleColumnFilterInfo* pFilterInfo, int32_t numOfFil
void setInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx, SSDataBlock* pBlock, int32_t order); void setInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx, SSDataBlock* pBlock, int32_t order);
int32_t getNumOfResult(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx* pCtx, int32_t numOfOutput); int32_t getNumOfResult(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx* pCtx, int32_t numOfOutput);
void finalizeQueryResult(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx, SResultRowInfo* pResultRowInfo, int32_t* rowCellInfoOffset); void finalizeQueryResult(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx, SResultRowInfo* pResultRowInfo, int32_t* rowCellInfoOffset);
void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOfInputRows); void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOfInputRows, SQueryRuntimeEnv* runtimeEnv);
void clearOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity); void clearOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity);
void copyTsColoum(SSDataBlock* pRes, SQLFunctionCtx* pCtx, int32_t numOfOutput); void copyTsColoum(SSDataBlock* pRes, SQLFunctionCtx* pCtx, int32_t numOfOutput);
......
...@@ -1432,7 +1432,7 @@ static void doWindowBorderInterpolation(SOperatorInfo* pOperatorInfo, SSDataBloc ...@@ -1432,7 +1432,7 @@ static void doWindowBorderInterpolation(SOperatorInfo* pOperatorInfo, SSDataBloc
int32_t step = GET_FORWARD_DIRECTION_FACTOR(pQueryAttr->order.order); int32_t step = GET_FORWARD_DIRECTION_FACTOR(pQueryAttr->order.order);
if (pBlock->pDataBlock == NULL){ if (pBlock->pDataBlock == NULL){
tscError("pBlock->pDataBlock == NULL"); qError("window border interpolation: pBlock->pDataBlock == NULL");
return; return;
} }
SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, 0); SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, 0);
...@@ -3586,7 +3586,7 @@ void setDefaultOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, SOptrBasicInfo *pInfo, i ...@@ -3586,7 +3586,7 @@ void setDefaultOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, SOptrBasicInfo *pInfo, i
initCtxOutputBuffer(pCtx, pDataBlock->info.numOfCols); initCtxOutputBuffer(pCtx, pDataBlock->info.numOfCols);
} }
void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOfInputRows) { void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOfInputRows, SQueryRuntimeEnv* runtimeEnv) {
SSDataBlock* pDataBlock = pBInfo->pRes; SSDataBlock* pDataBlock = pBInfo->pRes;
int32_t newSize = pDataBlock->info.rows + numOfInputRows + 5; // extra output buffer int32_t newSize = pDataBlock->info.rows + numOfInputRows + 5; // extra output buffer
...@@ -3594,7 +3594,7 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOf ...@@ -3594,7 +3594,7 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOf
for(int32_t i = 0; i < pDataBlock->info.numOfCols; ++i) { for(int32_t i = 0; i < pDataBlock->info.numOfCols; ++i) {
SColumnInfoData *pColInfo = taosArrayGet(pDataBlock->pDataBlock, i); SColumnInfoData *pColInfo = taosArrayGet(pDataBlock->pDataBlock, i);
char* p = realloc(pColInfo->pData, newSize * pColInfo->info.bytes); char* p = realloc(pColInfo->pData, ((size_t)newSize) * pColInfo->info.bytes);
if (p != NULL) { if (p != NULL) {
pColInfo->pData = p; pColInfo->pData = p;
...@@ -3602,7 +3602,10 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOf ...@@ -3602,7 +3602,10 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOf
pBInfo->pCtx[i].pOutput = pColInfo->pData; pBInfo->pCtx[i].pOutput = pColInfo->pData;
(*bufCapacity) = newSize; (*bufCapacity) = newSize;
} else { } else {
// longjmp size_t allocateSize = ((size_t)(newSize)) * pColInfo->info.bytes;
qError("can not allocate %zu bytes for output. Rows: %d, colBytes %d",
allocateSize, newSize, pColInfo->info.bytes);
longjmp(runtimeEnv->env, TSDB_CODE_QRY_OUT_OF_MEMORY);
} }
} }
} }
...@@ -3610,7 +3613,7 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOf ...@@ -3610,7 +3613,7 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOf
for (int32_t i = 0; i < pDataBlock->info.numOfCols; ++i) { for (int32_t i = 0; i < pDataBlock->info.numOfCols; ++i) {
SColumnInfoData *pColInfo = taosArrayGet(pDataBlock->pDataBlock, i); SColumnInfoData *pColInfo = taosArrayGet(pDataBlock->pDataBlock, i);
pBInfo->pCtx[i].pOutput = pColInfo->pData + pColInfo->info.bytes * pDataBlock->info.rows; pBInfo->pCtx[i].pOutput = pColInfo->pData + (size_t)pColInfo->info.bytes * pDataBlock->info.rows;
// set the correct pointer after the memory buffer reallocated. // set the correct pointer after the memory buffer reallocated.
int32_t functionId = pBInfo->pCtx[i].functionId; int32_t functionId = pBInfo->pCtx[i].functionId;
...@@ -5767,7 +5770,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) { ...@@ -5767,7 +5770,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again // the pDataBlock are always the same one, no need to call this again
setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order); setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order);
updateOutputBuf(&pProjectInfo->binfo, &pProjectInfo->bufCapacity, pBlock->info.rows); updateOutputBuf(&pProjectInfo->binfo, &pProjectInfo->bufCapacity, pBlock->info.rows, pOperator->pRuntimeEnv);
projectApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput); projectApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput);
if (pTableQueryInfo != NULL) { if (pTableQueryInfo != NULL) {
...@@ -5833,7 +5836,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) { ...@@ -5833,7 +5836,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again // the pDataBlock are always the same one, no need to call this again
setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order); setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order);
updateOutputBuf(&pProjectInfo->binfo, &pProjectInfo->bufCapacity, pBlock->info.rows); updateOutputBuf(&pProjectInfo->binfo, &pProjectInfo->bufCapacity, pBlock->info.rows, pOperator->pRuntimeEnv);
projectApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput); projectApplyFunctions(pRuntimeEnv, pInfo->pCtx, pOperator->numOfOutput);
if (pTableQueryInfo != NULL) { if (pTableQueryInfo != NULL) {
...@@ -6330,7 +6333,7 @@ static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDa ...@@ -6330,7 +6333,7 @@ static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDa
break; break;
} }
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0); updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0, pOperator->pRuntimeEnv);
} }
} }
} }
...@@ -6350,7 +6353,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6350,7 +6353,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
pRes->info.rows = 0; pRes->info.rows = 0;
if (!pEveryInfo->groupDone) { if (!pEveryInfo->groupDone) {
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0); updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0, pOperator->pRuntimeEnv);
doTimeEveryImpl(pOperator, pInfo->pCtx, pEveryInfo->lastBlock, false); doTimeEveryImpl(pOperator, pInfo->pCtx, pEveryInfo->lastBlock, false);
if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) { if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) {
copyTsColoum(pRes, pInfo->pCtx, pOperator->numOfOutput); copyTsColoum(pRes, pInfo->pCtx, pOperator->numOfOutput);
...@@ -6386,7 +6389,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6386,7 +6389,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again // the pDataBlock are always the same one, no need to call this again
setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order); setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order);
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, pBlock->info.rows); updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, pBlock->info.rows, pOperator->pRuntimeEnv);
doTimeEveryImpl(pOperator, pInfo->pCtx, pBlock, *newgroup); doTimeEveryImpl(pOperator, pInfo->pCtx, pBlock, *newgroup);
if (pEveryInfo->groupDone && pOperator->upstream[0]->notify) { if (pEveryInfo->groupDone && pOperator->upstream[0]->notify) {
...@@ -6412,7 +6415,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6412,7 +6415,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
if (!pEveryInfo->groupDone) { if (!pEveryInfo->groupDone) {
pEveryInfo->allDone = true; pEveryInfo->allDone = true;
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0); updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0, pOperator->pRuntimeEnv);
doTimeEveryImpl(pOperator, pInfo->pCtx, NULL, false); doTimeEveryImpl(pOperator, pInfo->pCtx, NULL, false);
if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) { if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) {
break; break;
...@@ -6433,7 +6436,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6433,7 +6436,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
// Return result of the previous group in the firstly. // Return result of the previous group in the firstly.
if (*newgroup) { if (*newgroup) {
if (!pEveryInfo->groupDone) { if (!pEveryInfo->groupDone) {
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0); updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0, pOperator->pRuntimeEnv);
doTimeEveryImpl(pOperator, pInfo->pCtx, NULL, false); doTimeEveryImpl(pOperator, pInfo->pCtx, NULL, false);
if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) { if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) {
pEveryInfo->existDataBlock = pBlock; pEveryInfo->existDataBlock = pBlock;
...@@ -6469,7 +6472,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) { ...@@ -6469,7 +6472,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again // the pDataBlock are always the same one, no need to call this again
setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order); setInputDataBlock(pOperator, pInfo->pCtx, pBlock, order);
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, pBlock->info.rows); updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, pBlock->info.rows, pOperator->pRuntimeEnv);
pEveryInfo->groupDone = false; pEveryInfo->groupDone = false;
......
#!/bin/bash #!/bin/bash
ulimit -c unlimited ulimit -c unlimited
#======================p1-start=============== #======================p1-start===============
python3 testCompress.py python3 testCompress.py
python3 testNoCompress.py python3 testNoCompress.py
python3 ./test.py -f import_merge/importBlock1HO.py python3 ./test.py -f import_merge/importBlock1HO.py
...@@ -130,9 +129,4 @@ python3 ./test.py -f update/merge_commit_last.py ...@@ -130,9 +129,4 @@ python3 ./test.py -f update/merge_commit_last.py
python3 ./test.py -f update/update_options.py python3 ./test.py -f update/update_options.py
python3 ./test.py -f update/merge_commit_data-0.py python3 ./test.py -f update/merge_commit_data-0.py
python3 ./test.py -f wal/addOldWalTest.py python3 ./test.py -f wal/addOldWalTest.py
python3 ./test.py -f wal/sdbComp.py # python3 ./test.py -f wal/sdbComp.py
\ No newline at end of file
#!/bin/bash #!/bin/bash
ulimit -c unlimited ulimit -c unlimited
#======================p1-start=============== #======================p1-start===============
#python3 ./test.py -f dbmgmt/database-name-boundary.py #python3 ./test.py -f dbmgmt/database-name-boundary.py
python3 test.py -f dbmgmt/nanoSecondCheck.py python3 test.py -f dbmgmt/nanoSecondCheck.py
# #
python3 ./test.py -f tsdb/tsdbComp.py python3 ./test.py -f tsdb/tsdbComp.py
# user # user
python3 ./test.py -f user/user_create.py python3 ./test.py -f user/user_create.py
python3 ./test.py -f user/pass_len.py python3 ./test.py -f user/pass_len.py
#======================p1-end=============== #======================p1-end===============
#======================p2-start=============== #======================p2-start===============
# perfbenchmark # perfbenchmark
python3 ./test.py -f perfbenchmark/bug3433.py python3 ./test.py -f perfbenchmark/bug3433.py
#python3 ./test.py -f perfbenchmark/bug3589.py #python3 ./test.py -f perfbenchmark/bug3589.py
#python3 ./test.py -f perfbenchmark/taosdemoInsert.py #python3 ./test.py -f perfbenchmark/taosdemoInsert.py
#alter table #alter table
python3 ./test.py -f alter/alter_table_crash.py python3 ./test.py -f alter/alter_table_crash.py
python3 ./test.py -f alter/alterTabAddTagWithNULL.py python3 ./test.py -f alter/alterTabAddTagWithNULL.py
python3 ./test.py -f alter/alterTimestampColDataProcess.py python3 ./test.py -f alter/alterTimestampColDataProcess.py
#======================p2-end=============== #======================p2-end===============
#======================p3-start=============== #======================p3-start===============
python3 ./test.py -f alter/alter_table.py python3 ./test.py -f alter/alter_table.py
python3 ./test.py -f alter/alter_debugFlag.py python3 ./test.py -f alter/alter_debugFlag.py
python3 ./test.py -f alter/alter_keep.py python3 ./test.py -f alter/alter_keep.py
python3 ./test.py -f alter/alter_cacheLastRow.py python3 ./test.py -f alter/alter_cacheLastRow.py
python3 ./test.py -f alter/alter_create_exception.py python3 ./test.py -f alter/alter_create_exception.py
python3 ./test.py -f alter/alterColMultiTimes.py python3 ./test.py -f alter/alterColMultiTimes.py
#======================p3-end=============== #======================p3-end===============
#======================p4-start=============== #======================p4-start===============
python3 ./test.py -f account/account_create.py python3 ./test.py -f account/account_create.py
# client # client
python3 ./test.py -f client/client.py python3 ./test.py -f client/client.py
python3 ./test.py -f client/version.py python3 ./test.py -f client/version.py
...@@ -50,12 +39,10 @@ python3 ./test.py -f client/taoshellCheckCase.py ...@@ -50,12 +39,10 @@ python3 ./test.py -f client/taoshellCheckCase.py
# python3 ./test.py -f client/change_time_1_2.py # python3 ./test.py -f client/change_time_1_2.py
python3 client/twoClients.py python3 client/twoClients.py
python3 testMinTablesPerVnode.py python3 testMinTablesPerVnode.py
# topic # topic
python3 ./test.py -f topic/topicQuery.py python3 ./test.py -f topic/topicQuery.py
#======================p4-end=============== #======================p4-end===============
#======================p5-start=============== #======================p5-start===============
python3 ./test.py -f ../system-test/0-management/1-stable/create_col_tag.py python3 ./test.py -f ../system-test/0-management/1-stable/create_col_tag.py
python3 ./test.py -f ../develop-test/0-management/3-tag/json_tag.py python3 ./test.py -f ../develop-test/0-management/3-tag/json_tag.py
#======================p5-end===============
#======================p5-end=============== \ No newline at end of file
#!/bin/bash #!/bin/bash
ulimit -c unlimited ulimit -c unlimited
#======================p1-start=============== #======================p1-start===============
# timezone # timezone
python3 ./test.py -f TimeZone/TestCaseTimeZone.py python3 ./test.py -f TimeZone/TestCaseTimeZone.py
#stable #stable
python3 ./test.py -f stable/insert.py python3 ./test.py -f stable/insert.py
python3 ./test.py -f stable/query_after_reset.py python3 ./test.py -f stable/query_after_reset.py
#table #table
python3 ./test.py -f table/alter_wal0.py python3 ./test.py -f table/alter_wal0.py
python3 ./test.py -f table/column_name.py python3 ./test.py -f table/column_name.py
...@@ -22,7 +19,6 @@ python3 ./test.py -f table/boundary.py ...@@ -22,7 +19,6 @@ python3 ./test.py -f table/boundary.py
#python3 ./test.py -f table/create.py #python3 ./test.py -f table/create.py
python3 ./test.py -f table/del_stable.py python3 ./test.py -f table/del_stable.py
python3 ./test.py -f table/create_db_from_normal_db.py python3 ./test.py -f table/create_db_from_normal_db.py
# tag # tag
python3 ./test.py -f tag_lite/filter.py python3 ./test.py -f tag_lite/filter.py
python3 ./test.py -f tag_lite/create-tags-boundary.py python3 ./test.py -f tag_lite/create-tags-boundary.py
...@@ -38,10 +34,8 @@ python3 ./test.py -f tag_lite/bool_binary.py ...@@ -38,10 +34,8 @@ python3 ./test.py -f tag_lite/bool_binary.py
python3 ./test.py -f tag_lite/bool_int.py python3 ./test.py -f tag_lite/bool_int.py
python3 ./test.py -f tag_lite/bool.py python3 ./test.py -f tag_lite/bool.py
python3 ./test.py -f tag_lite/change.py python3 ./test.py -f tag_lite/change.py
#======================p1-end=============== #======================p1-end===============
#======================p2-start=============== #======================p2-start===============
python3 ./test.py -f tag_lite/column.py python3 ./test.py -f tag_lite/column.py
python3 ./test.py -f tag_lite/commit.py python3 ./test.py -f tag_lite/commit.py
python3 ./test.py -f tag_lite/create.py python3 ./test.py -f tag_lite/create.py
...@@ -65,10 +59,8 @@ python3 ./test.py -f tag_lite/unsignedTinyint.py ...@@ -65,10 +59,8 @@ python3 ./test.py -f tag_lite/unsignedTinyint.py
python3 ./test.py -f tag_lite/alter_tag.py python3 ./test.py -f tag_lite/alter_tag.py
python3 ./test.py -f tag_lite/drop_auto_create.py python3 ./test.py -f tag_lite/drop_auto_create.py
python3 ./test.py -f tag_lite/json_tag_extra.py python3 ./test.py -f tag_lite/json_tag_extra.py
#======================p2-end=============== #======================p2-end===============
#======================p3-start=============== #======================p3-start===============
#query #query
python3 ./test.py -f query/distinctOneColTb.py python3 ./test.py -f query/distinctOneColTb.py
python3 ./test.py -f query/filter.py python3 ./test.py -f query/filter.py
...@@ -118,10 +110,8 @@ python3 ./test.py -f query/subqueryFilter.py ...@@ -118,10 +110,8 @@ python3 ./test.py -f query/subqueryFilter.py
python3 ./test.py -f query/nestedQuery/queryInterval.py python3 ./test.py -f query/nestedQuery/queryInterval.py
python3 ./test.py -f query/queryStateWindow.py python3 ./test.py -f query/queryStateWindow.py
# python3 ./test.py -f query/nestedQuery/queryWithOrderLimit.py # python3 ./test.py -f query/nestedQuery/queryWithOrderLimit.py
#======================p3-end=============== #======================p3-end===============
#======================p4-start=============== #======================p4-start===============
python3 ./test.py -f query/nestquery_last_row.py python3 ./test.py -f query/nestquery_last_row.py
python3 ./test.py -f query/nestedQuery/nestedQuery.py python3 ./test.py -f query/nestedQuery/nestedQuery.py
python3 ./test.py -f query/nestedQuery/nestedQuery_datacheck.py python3 ./test.py -f query/nestedQuery/nestedQuery_datacheck.py
...@@ -145,7 +135,6 @@ python3 ./test.py -f query/query.py ...@@ -145,7 +135,6 @@ python3 ./test.py -f query/query.py
python3 ./test.py -f query/queryDiffColsTagsAndOr.py python3 ./test.py -f query/queryDiffColsTagsAndOr.py
python3 ./test.py -f query/queryGroupTbname.py python3 ./test.py -f query/queryGroupTbname.py
python3 ./test.py -f query/queryRegex.py python3 ./test.py -f query/queryRegex.py
#stream #stream
python3 ./test.py -f stream/metric_1.py python3 ./test.py -f stream/metric_1.py
python3 ./test.py -f stream/metric_n.py python3 ./test.py -f stream/metric_n.py
...@@ -159,18 +148,14 @@ python3 ./test.py -f stream/table_1.py ...@@ -159,18 +148,14 @@ python3 ./test.py -f stream/table_1.py
python3 ./test.py -f stream/table_n.py python3 ./test.py -f stream/table_n.py
python3 ./test.py -f stream/showStreamExecTimeisNull.py python3 ./test.py -f stream/showStreamExecTimeisNull.py
python3 ./test.py -f stream/cqSupportBefore1970.py python3 ./test.py -f stream/cqSupportBefore1970.py
python3 ./test.py -f query/queryGroupbyWithInterval.py python3 ./test.py -f query/queryGroupbyWithInterval.py
python3 queryCount.py python3 queryCount.py
# subscribe # subscribe
python3 test.py -f subscribe/singlemeter.py python3 test.py -f subscribe/singlemeter.py
#python3 test.py -f subscribe/stability.py #python3 test.py -f subscribe/stability.py
python3 test.py -f subscribe/supertable.py python3 test.py -f subscribe/supertable.py
#======================p4-end=============== #======================p4-end===============
#======================p5-start=============== #======================p5-start===============
# functions # functions
python3 ./test.py -f functions/all_null_value.py python3 ./test.py -f functions/all_null_value.py
python3 ./test.py -f functions/function_avg.py -r 1 python3 ./test.py -f functions/function_avg.py -r 1
...@@ -208,12 +193,6 @@ python3 ./test.py -f functions/function_mavg.py ...@@ -208,12 +193,6 @@ python3 ./test.py -f functions/function_mavg.py
python3 ./test.py -f functions/function_csum.py python3 ./test.py -f functions/function_csum.py
python3 ./test.py -f functions/function_percentile2.py python3 ./test.py -f functions/function_percentile2.py
python3 ./test.py -f functions/variable_httpDbNameMandatory.py python3 ./test.py -f functions/variable_httpDbNameMandatory.py
######## system-test ######## system-test
#python3 ./test.py -f ../system-test/2-query/9-others/TD-11389.py # this case will run when this bug fix TD-11389 #python3 ./test.py -f ../system-test/2-query/9-others/TD-11389.py # this case will run when this bug fix TD-11389
#======================p5-end===============
\ No newline at end of file
#======================p5-end===============
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
import sys import sys
import os import os, time
from util.log import * from util.log import *
from util.cases import * from util.cases import *
from util.sql import * from util.sql import *
...@@ -107,6 +107,7 @@ class TDTestCase: ...@@ -107,6 +107,7 @@ class TDTestCase:
# insert by csv files and timetamp is long int , strings in ts and # insert by csv files and timetamp is long int , strings in ts and
# cols # cols
os.system( os.system(
"%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " % "%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " %
binPath) binPath)
...@@ -117,9 +118,11 @@ class TDTestCase: ...@@ -117,9 +118,11 @@ class TDTestCase:
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0") tdSql.query("describe stb0")
tdSql.checkDataType(3, 1, "TIMESTAMP") tdSql.checkDataType(3, 1, "TIMESTAMP")
tdSql.query( tdSql.query(
"select count(*) from stb0 where ts > \"2021-07-01 00:00:00.490000000\"") "select count(*) from nsdbcsv.stb0 where ts > \"2021-07-01 00:00:00.490000000\"")
tdSql.checkData(0, 0, 5000) tdSql.checkData(0, 0, 5000)
tdSql.query("select count(*) from stb0 where ts < 1626918583000000000") tdSql.query("select count(*) from stb0 where ts < 1626918583000000000")
tdSql.checkData(0, 0, 10000) tdSql.checkData(0, 0, 10000)
...@@ -134,31 +137,9 @@ class TDTestCase: ...@@ -134,31 +137,9 @@ class TDTestCase:
binPath) binPath)
tdSql.query("select count(*) from test.meters") tdSql.query("select count(*) from test.meters")
tdSql.checkData(0, 0, 600) tdSql.checkData(0, 0, 600)
# check taosdemo -s
sqls_ls = [
'drop database if exists nsdbsql;',
'create database nsdbsql precision "ns" keep 3600 days 6 update 1;',
'use nsdbsql;',
'CREATE STABLE meters (ts timestamp, current float, voltage int, phase float) TAGS (location binary(64), groupdId int);',
'CREATE TABLE d1001 USING meters TAGS ("Beijing.Chaoyang", 2);',
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 10.2, 219, 0.32);',
'INSERT INTO d1001 USING METERS TAGS ("Beijng.Chaoyang", 2) VALUES (now, 85, 32, 0.76);']
with open("./taosdemoTestNanoCreateDB.sql", mode="a") as sql_files:
for sql in sqls_ls:
sql_files.write(sql + "\n")
sql_files.close()
sleep(10)
os.system("%staosBenchmark -s taosdemoTestNanoCreateDB.sql -y " % binPath)
tdSql.query("select count(*) from nsdbsql.meters")
tdSql.checkData(0, 0, 2)
os.system("rm -rf ./res.txt") os.system("rm -rf ./res.txt")
os.system("rm -rf ./*.py.sql") os.system("rm -rf ./*.py.sql")
os.system("rm -rf ./taosdemoTestNanoCreateDB.sql")
def stop(self): def stop(self):
tdSql.close() tdSql.close()
......
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "INT"}], "columns": [{"type": "INT"}],
"tags": [{"type": "INT", "count":1}] "tags": [{"type": "INT", "count":6}]
}, },
{ {
"name": "stb1", "name": "stb1",
...@@ -81,8 +81,8 @@ ...@@ -81,8 +81,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "TINYINT", "count":1}], "columns": [{"type": "TINYINT", "count":6}],
"tags": [{"type": "TINYINT", "count":1}] "tags": [{"type": "TINYINT", "count":6}]
}, },
{ {
"name": "stb2", "name": "stb2",
...@@ -108,7 +108,7 @@ ...@@ -108,7 +108,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "BIGINT"}], "columns": [{"type": "BIGINT"}],
"tags": [{"type": "BIGINT", "count":1}] "tags": [{"type": "BIGINT", "count":6}]
}, },
{ {
"name": "stb3", "name": "stb3",
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "SMALLINT"}], "columns": [{"type": "SMALLINT"}],
"tags": [{"type": "SMALLINT", "count":1}] "tags": [{"type": "SMALLINT", "count":6}]
}, },
{ {
"name": "stb4", "name": "stb4",
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "FLOAT"}], "columns": [{"type": "FLOAT"}],
"tags": [{"type": "FLOAT", "count":1}] "tags": [{"type": "FLOAT", "count":6}]
}, },
{ {
"name": "stb5", "name": "stb5",
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "DOUBLE"}], "columns": [{"type": "DOUBLE"}],
"tags": [{"type": "DOUBLE", "count":1}] "tags": [{"type": "DOUBLE", "count":6}]
}, },
{ {
"name": "stb6", "name": "stb6",
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "UINT"}], "columns": [{"type": "UINT"}],
"tags": [{"type": "UINT", "count":1}] "tags": [{"type": "UINT", "count":6}]
}, },
{ {
"name": "stb7", "name": "stb7",
...@@ -237,8 +237,8 @@ ...@@ -237,8 +237,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [ {"type": "BOOL"}], "columns": [ {"type": "INT"}],
"tags": [{"type": "BOOL", "count":1}] "tags": [{"type": "INT", "count":3}]
}, },
{ {
"name": "stb8", "name": "stb8",
...@@ -263,8 +263,8 @@ ...@@ -263,8 +263,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "NCHAR","len": 16, "count":1}], "columns": [{"type": "NCHAR","len": 16, "count":6}],
"tags": [{"type": "NCHAR", "count":1}] "tags": [{"type": "NCHAR", "count":6}]
}, },
{ {
"name": "stb9", "name": "stb9",
...@@ -289,8 +289,8 @@ ...@@ -289,8 +289,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "BINARY", "len": 16, "count":1}], "columns": [{"type": "BINARY", "len": 16, "count":6}],
"tags": [{"type": "BINARY", "count":1}] "tags": [{"type": "BINARY", "count":6}]
}, },
{ {
"name": "stb10", "name": "stb10",
...@@ -316,7 +316,7 @@ ...@@ -316,7 +316,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "UBIGINT"}], "columns": [{"type": "UBIGINT"}],
"tags": [{"type": "UBIGINT", "count":1}] "tags": [{"type": "UBIGINT", "count":6}]
}, },
{ {
"name": "stb11", "name": "stb11",
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "UTINYINT"}], "columns": [{"type": "UTINYINT"}],
"tags": [{"type": "UTINYINT", "count":1}] "tags": [{"type": "UTINYINT", "count":3}]
}, },
{ {
"name": "stb12", "name": "stb12",
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [ {"type": "USMALLINT"}], "columns": [ {"type": "USMALLINT"}],
"tags": [{"type": "USMALLINT", "count":1}] "tags": [{"type": "USMALLINT", "count":6}]
}] }]
}] }]
} }
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "INT"}], "columns": [{"type": "INT"}],
"tags": [{"type": "INT", "count":1}] "tags": [{"type": "INT", "count":6}]
}, },
{ {
"name": "stb1", "name": "stb1",
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "UINT"}], "columns": [{"type": "UINT"}],
"tags": [{"type": "UINT", "count":1}] "tags": [{"type": "UINT", "count":6}]
}, },
{ {
"name": "stb2", "name": "stb2",
...@@ -107,8 +107,8 @@ ...@@ -107,8 +107,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "TINYINT", "count":1}], "columns": [{"type": "TINYINT", "count":6}],
"tags": [{"type": "TINYINT", "count":1}] "tags": [{"type": "TINYINT", "count":6}]
}, },
{ {
"name": "stb3", "name": "stb3",
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "BIGINT"}], "columns": [{"type": "BIGINT"}],
"tags": [{"type": "BIGINT", "count":1}] "tags": [{"type": "BIGINT", "count":6}]
}, },
{ {
"name": "stb4", "name": "stb4",
...@@ -160,7 +160,7 @@ ...@@ -160,7 +160,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "SMALLINT"}], "columns": [{"type": "SMALLINT"}],
"tags": [{"type": "SMALLINT", "count":1}] "tags": [{"type": "SMALLINT", "count":6}]
}, },
{ {
"name": "stb5", "name": "stb5",
...@@ -186,7 +186,7 @@ ...@@ -186,7 +186,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "FLOAT"}], "columns": [{"type": "FLOAT"}],
"tags": [{"type": "FLOAT", "count":1}] "tags": [{"type": "FLOAT", "count":6}]
}, },
{ {
"name": "stb6", "name": "stb6",
...@@ -212,7 +212,7 @@ ...@@ -212,7 +212,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "DOUBLE"}], "columns": [{"type": "DOUBLE"}],
"tags": [{"type": "DOUBLE", "count":1}] "tags": [{"type": "DOUBLE", "count":6}]
}, },
{ {
"name": "stb7", "name": "stb7",
...@@ -237,8 +237,8 @@ ...@@ -237,8 +237,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [ {"type": "BOOL"}], "columns": [ {"type": "int"}],
"tags": [{"type": "BOOL", "count":1}] "tags": [{"type": "int", "count":6}]
}, },
{ {
"name": "stb8", "name": "stb8",
...@@ -263,8 +263,8 @@ ...@@ -263,8 +263,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "NCHAR","len": 16, "count":1}], "columns": [{"type": "NCHAR","len": 16, "count":6}],
"tags": [{"type": "NCHAR", "count":1}] "tags": [{"type": "NCHAR", "count":6}]
}, },
{ {
"name": "stb9", "name": "stb9",
...@@ -289,8 +289,8 @@ ...@@ -289,8 +289,8 @@
"sample_format": "csv", "sample_format": "csv",
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "BINARY", "len": 16, "count":1}], "columns": [{"type": "BINARY", "len": 16, "count":6}],
"tags": [{"type": "BINARY", "count":1}] "tags": [{"type": "BINARY", "count":6}]
}, },
{ {
"name": "stb10", "name": "stb10",
...@@ -316,7 +316,7 @@ ...@@ -316,7 +316,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "UBIGINT"}], "columns": [{"type": "UBIGINT"}],
"tags": [{"type": "UBIGINT", "count":1}] "tags": [{"type": "UBIGINT", "count":6}]
}, },
{ {
"name": "stb11", "name": "stb11",
...@@ -342,7 +342,7 @@ ...@@ -342,7 +342,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [{"type": "UTINYINT"}], "columns": [{"type": "UTINYINT"}],
"tags": [{"type": "UTINYINT", "count":1}] "tags": [{"type": "UTINYINT", "count":6}]
}, },
{ {
"name": "stb12", "name": "stb12",
...@@ -368,7 +368,7 @@ ...@@ -368,7 +368,7 @@
"sample_file": "./sample.csv", "sample_file": "./sample.csv",
"tags_file": "", "tags_file": "",
"columns": [ {"type": "USMALLINT"}], "columns": [ {"type": "USMALLINT"}],
"tags": [{"type": "USMALLINT", "count":1}] "tags": [{"type": "USMALLINT", "count":6}]
}] }]
}] }]
} }
...@@ -268,16 +268,16 @@ class TDTestCase: ...@@ -268,16 +268,16 @@ class TDTestCase:
tdSql.checkData(0, 0, 10) tdSql.checkData(0, 0, 10)
# insert: sample json # insert: sample json
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath) #os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
tdSql.execute("use dbtest123") #tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0") #tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647) #tdSql.checkData(0, 0, 2147483647)
tdSql.query("select * from stb1 where t1=-127") #tdSql.query("select * from stb1 where t1=-127")
tdSql.checkRows(20) #tdSql.checkRows(20)
tdSql.query("select * from stb1 where t2=127") #tdSql.query("select * from stb1 where t2=127")
tdSql.checkRows(10) #tdSql.checkRows(10)
tdSql.query("select * from stb1 where t2=126") #tdSql.query("select * from stb1 where t2=126")
tdSql.checkRows(10) #tdSql.checkRows(10)
# insert: test interlace parament # insert: test interlace parament
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-interlace-row-stmt.json -y " % binPath) os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-interlace-row-stmt.json -y " % binPath)
......
...@@ -27,6 +27,7 @@ class TDTestCase: ...@@ -27,6 +27,7 @@ class TDTestCase:
self.ts = 1601481600000 self.ts = 1601481600000
self.numberOfTables = 1 self.numberOfTables = 1
self.numberOfRecords = 15000 self.numberOfRecords = 15000
self.tmpdir = "tmp"
def getBuildPath(self): def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__)) selfPath = os.path.dirname(os.path.realpath(__file__))
...@@ -67,16 +68,22 @@ class TDTestCase: ...@@ -67,16 +68,22 @@ class TDTestCase:
tdLog.info("taosdump found in %s" % buildPath) tdLog.info("taosdump found in %s" % buildPath)
binPath = buildPath + "/build/bin/" binPath = buildPath + "/build/bin/"
os.system("rm /tmp/*.sql") if not os.path.exists(self.tmpdir):
os.makedirs(self.tmpdir)
else:
print("directory exists")
os.system("rm -rf %s" % self.tmpdir)
os.makedirs(self.tmpdir)
os.system( os.system(
"%staosdump --databases db -o /tmp -B 16384 -L 1048576" % "%staosdump --databases db -o %s -B 16384 " %
binPath) (binPath, self.tmpdir))
tdSql.execute("drop database db") tdSql.execute("drop database db")
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkRows(0) tdSql.checkRows(0)
os.system("%staosdump -i /tmp" % binPath) os.system("%staosdump -i %s" % (binPath, self.tmpdir))
tdSql.query("show databases") tdSql.query("show databases")
tdSql.checkRows(1) tdSql.checkRows(1)
......
cd ../../../debug; cmake .. cd ../../../debug; cmake ..
cd ../../../debug; make cd ../../../debug; make
#======================b1-start=============== #======================b1-start===============
./test.sh -f general/field/2.sim ./test.sh -f general/field/2.sim
./test.sh -f general/field/3.sim ./test.sh -f general/field/3.sim
./test.sh -f general/field/4.sim ./test.sh -f general/field/4.sim
...@@ -14,8 +12,6 @@ cd ../../../debug; make ...@@ -14,8 +12,6 @@ cd ../../../debug; make
./test.sh -f general/field/single.sim ./test.sh -f general/field/single.sim
./test.sh -f general/field/smallint.sim ./test.sh -f general/field/smallint.sim
./test.sh -f general/field/tinyint.sim ./test.sh -f general/field/tinyint.sim
# ./test.sh -f general/http/autocreate.sim # ./test.sh -f general/http/autocreate.sim
# ./test.sh -f general/http/chunked.sim # ./test.sh -f general/http/chunked.sim
# ./test.sh -f general/http/gzip.sim # ./test.sh -f general/http/gzip.sim
...@@ -27,7 +23,6 @@ cd ../../../debug; make ...@@ -27,7 +23,6 @@ cd ../../../debug; make
# ./test.sh -f general/http/telegraf.sim # ./test.sh -f general/http/telegraf.sim
# ./test.sh -f general/http/grafana_bug.sim # ./test.sh -f general/http/grafana_bug.sim
# ./test.sh -f general/http/grafana.sim # ./test.sh -f general/http/grafana.sim
./test.sh -f general/insert/basic.sim ./test.sh -f general/insert/basic.sim
./test.sh -f general/insert/insert_drop.sim ./test.sh -f general/insert/insert_drop.sim
./test.sh -f general/insert/query_block1_memory.sim ./test.sh -f general/insert/query_block1_memory.sim
...@@ -37,7 +32,6 @@ cd ../../../debug; make ...@@ -37,7 +32,6 @@ cd ../../../debug; make
./test.sh -f general/insert/query_file_memory.sim ./test.sh -f general/insert/query_file_memory.sim
./test.sh -f general/insert/query_multi_file.sim ./test.sh -f general/insert/query_multi_file.sim
./test.sh -f general/insert/tcp.sim ./test.sh -f general/insert/tcp.sim
./test.sh -f general/parser/alter.sim ./test.sh -f general/parser/alter.sim
./test.sh -f general/parser/alter1.sim ./test.sh -f general/parser/alter1.sim
./test.sh -f general/parser/alter_stable.sim ./test.sh -f general/parser/alter_stable.sim
...@@ -90,30 +84,22 @@ cd ../../../debug; make ...@@ -90,30 +84,22 @@ cd ../../../debug; make
./test.sh -f general/db/nosuchfile.sim ./test.sh -f general/db/nosuchfile.sim
./test.sh -f general/parser/function.sim ./test.sh -f general/parser/function.sim
./test.sh -f unique/cluster/vgroup100.sim ./test.sh -f unique/cluster/vgroup100.sim
# ./test.sh -f unique/http/admin.sim # ./test.sh -f unique/http/admin.sim
# ./test.sh -f unique/http/opentsdb.sim # ./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim ./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim ./test.sh -f unique/import/replica3.sim
./test.sh -f general/alter/cached_schema_after_alter.sim ./test.sh -f general/alter/cached_schema_after_alter.sim
#======================b1-end=============== #======================b1-end===============
#======================b2-start=============== #======================b2-start===============
#./test.sh -f general/wal/sync.sim #./test.sh -f general/wal/sync.sim
./test.sh -f general/wal/kill.sim ./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim ./test.sh -f general/wal/maxtables.sim
./test.sh -f general/user/authority.sim ./test.sh -f general/user/authority.sim
./test.sh -f general/user/monitor.sim ./test.sh -f general/user/monitor.sim
./test.sh -f general/user/pass_alter.sim ./test.sh -f general/user/pass_alter.sim
./test.sh -f general/user/pass_len.sim ./test.sh -f general/user/pass_len.sim
./test.sh -f general/user/user_create.sim ./test.sh -f general/user/user_create.sim
./test.sh -f general/user/user_len.sim ./test.sh -f general/user/user_len.sim
./test.sh -f general/vector/metrics_field.sim ./test.sh -f general/vector/metrics_field.sim
./test.sh -f general/vector/metrics_mix.sim ./test.sh -f general/vector/metrics_mix.sim
./test.sh -f general/vector/metrics_query.sim ./test.sh -f general/vector/metrics_query.sim
...@@ -125,7 +111,6 @@ cd ../../../debug; make ...@@ -125,7 +111,6 @@ cd ../../../debug; make
./test.sh -f general/vector/table_mix.sim ./test.sh -f general/vector/table_mix.sim
./test.sh -f general/vector/table_query.sim ./test.sh -f general/vector/table_query.sim
./test.sh -f general/vector/table_time.sim ./test.sh -f general/vector/table_time.sim
./test.sh -f unique/account/account_create.sim ./test.sh -f unique/account/account_create.sim
./test.sh -f unique/account/account_delete.sim ./test.sh -f unique/account/account_delete.sim
./test.sh -f unique/account/account_len.sim ./test.sh -f unique/account/account_len.sim
...@@ -137,24 +122,17 @@ cd ../../../debug; make ...@@ -137,24 +122,17 @@ cd ../../../debug; make
./test.sh -f unique/account/usage.sim ./test.sh -f unique/account/usage.sim
./test.sh -f unique/account/user_create.sim ./test.sh -f unique/account/user_create.sim
./test.sh -f unique/account/user_len.sim ./test.sh -f unique/account/user_len.sim
./test.sh -f unique/big/maxvnodes.sim ./test.sh -f unique/big/maxvnodes.sim
./test.sh -f unique/big/tcp.sim ./test.sh -f unique/big/tcp.sim
./test.sh -f unique/cluster/alter.sim ./test.sh -f unique/cluster/alter.sim
./test.sh -f unique/cluster/cache.sim ./test.sh -f unique/cluster/cache.sim
#./test.sh -f unique/http/admin.sim #./test.sh -f unique/http/admin.sim
#./test.sh -f unique/http/opentsdb.sim #./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim ./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim ./test.sh -f unique/import/replica3.sim
./test.sh -f general/alter/cached_schema_after_alter.sim ./test.sh -f general/alter/cached_schema_after_alter.sim
#======================b2-end=============== #======================b2-end===============
#======================b3-start=============== #======================b3-start===============
./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim ./test.sh -f unique/arbitrator/check_cluster_cfg_para.sim
#./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim #./test.sh -f unique/arbitrator/dn2_mn1_cache_file_sync.sim
./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim ./test.sh -f unique/arbitrator/dn3_mn1_full_createTableFail.sim
...@@ -175,7 +153,6 @@ cd ../../../debug; make ...@@ -175,7 +153,6 @@ cd ../../../debug; make
./test.sh -f unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim ./test.sh -f unique/arbitrator/dn3_mn1_r3_vnode_delDir.sim
./test.sh -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim ./test.sh -f unique/arbitrator/dn3_mn1_vnode_nomaster.sim
./test.sh -f unique/arbitrator/dn3_mn2_killDnode.sim ./test.sh -f unique/arbitrator/dn3_mn2_killDnode.sim
./test.sh -f unique/arbitrator/offline_replica2_alterTable_online.sim ./test.sh -f unique/arbitrator/offline_replica2_alterTable_online.sim
./test.sh -f unique/arbitrator/offline_replica2_alterTag_online.sim ./test.sh -f unique/arbitrator/offline_replica2_alterTag_online.sim
./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim ./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim
...@@ -189,19 +166,16 @@ cd ../../../debug; make ...@@ -189,19 +166,16 @@ cd ../../../debug; make
./test.sh -f unique/arbitrator/replica_changeWithArbitrator.sim ./test.sh -f unique/arbitrator/replica_changeWithArbitrator.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_add.sim ./test.sh -f unique/arbitrator/sync_replica2_alterTable_add.sim
./test.sh -f unique/arbitrator/sync_replica2_alterTable_drop.sim ./test.sh -f unique/arbitrator/sync_replica2_alterTable_drop.sim
./test.sh -f unique/arbitrator/sync_replica2_dropDb.sim ./test.sh -f unique/arbitrator/sync_replica2_dropDb.sim
./test.sh -f unique/arbitrator/sync_replica2_dropTable.sim ./test.sh -f unique/arbitrator/sync_replica2_dropTable.sim
./test.sh -f unique/arbitrator/sync_replica3_alterTable_add.sim ./test.sh -f unique/arbitrator/sync_replica3_alterTable_add.sim
./test.sh -f unique/arbitrator/sync_replica3_alterTable_drop.sim ./test.sh -f unique/arbitrator/sync_replica3_alterTable_drop.sim
./test.sh -f unique/arbitrator/sync_replica3_dropDb.sim ./test.sh -f unique/arbitrator/sync_replica3_dropDb.sim
./test.sh -f unique/arbitrator/sync_replica3_dropTable.sim ./test.sh -f unique/arbitrator/sync_replica3_dropTable.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim ./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim ./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim ./test.sh -f unique/migrate/mn2_vn2_repl2_rmMnodeVnodeDir_stopAll_starAll.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim ./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
./test.sh -f unique/stable/balance_replica1.sim ./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim ./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim ./test.sh -f unique/stable/dnode2.sim
...@@ -210,11 +184,8 @@ cd ../../../debug; make ...@@ -210,11 +184,8 @@ cd ../../../debug; make
./test.sh -f unique/stable/replica2_vnode3.sim ./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim ./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim ./test.sh -f unique/stable/replica3_vnode3.sim
#======================b3-end=============== #======================b3-end===============
#======================b4-start=============== #======================b4-start===============
./test.sh -f general/alter/count.sim ./test.sh -f general/alter/count.sim
./test.sh -f general/alter/dnode.sim ./test.sh -f general/alter/dnode.sim
./test.sh -f general/alter/import.sim ./test.sh -f general/alter/import.sim
...@@ -222,22 +193,17 @@ cd ../../../debug; make ...@@ -222,22 +193,17 @@ cd ../../../debug; make
./test.sh -f general/alter/insert2.sim ./test.sh -f general/alter/insert2.sim
./test.sh -f general/alter/metrics.sim ./test.sh -f general/alter/metrics.sim
./test.sh -f general/alter/table.sim ./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim ./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim ./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim ./test.sh -f general/cache/restart_table.sim
./test.sh -f general/connection/connection.sim ./test.sh -f general/connection/connection.sim
./test.sh -f general/column/commit.sim ./test.sh -f general/column/commit.sim
./test.sh -f general/column/metrics.sim ./test.sh -f general/column/metrics.sim
./test.sh -f general/column/table.sim ./test.sh -f general/column/table.sim
./test.sh -f general/compress/commitlog.sim ./test.sh -f general/compress/commitlog.sim
./test.sh -f general/compress/compress.sim ./test.sh -f general/compress/compress.sim
./test.sh -f general/compress/compress2.sim ./test.sh -f general/compress/compress2.sim
./test.sh -f general/compress/uncompress.sim ./test.sh -f general/compress/uncompress.sim
./test.sh -f general/stable/disk.sim ./test.sh -f general/stable/disk.sim
./test.sh -f general/stable/dnode3.sim ./test.sh -f general/stable/dnode3.sim
./test.sh -f general/stable/metrics.sim ./test.sh -f general/stable/metrics.sim
...@@ -245,7 +211,6 @@ cd ../../../debug; make ...@@ -245,7 +211,6 @@ cd ../../../debug; make
./test.sh -f general/stable/show.sim ./test.sh -f general/stable/show.sim
./test.sh -f general/stable/values.sim ./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim ./test.sh -f general/stable/vnode3.sim
./test.sh -f unique/column/replica3.sim ./test.sh -f unique/column/replica3.sim
./test.sh -f issue/TD-2713.sim ./test.sh -f issue/TD-2713.sim
./test.sh -f general/parser/select_distinct_tag.sim ./test.sh -f general/parser/select_distinct_tag.sim
...@@ -253,10 +218,8 @@ cd ../../../debug; make ...@@ -253,10 +218,8 @@ cd ../../../debug; make
./test.sh -f issue/TD-2677.sim ./test.sh -f issue/TD-2677.sim
./test.sh -f issue/TD-2680.sim ./test.sh -f issue/TD-2680.sim
./test.sh -f unique/dnode/lossdata.sim ./test.sh -f unique/dnode/lossdata.sim
#======================b4-end=============== #======================b4-end===============
#======================b5-start=============== #======================b5-start===============
./test.sh -f unique/dnode/alternativeRole.sim ./test.sh -f unique/dnode/alternativeRole.sim
./test.sh -f unique/dnode/balance1.sim ./test.sh -f unique/dnode/balance1.sim
./test.sh -f unique/dnode/balance2.sim ./test.sh -f unique/dnode/balance2.sim
...@@ -264,7 +227,6 @@ cd ../../../debug; make ...@@ -264,7 +227,6 @@ cd ../../../debug; make
./test.sh -f unique/dnode/balancex.sim ./test.sh -f unique/dnode/balancex.sim
./test.sh -f unique/dnode/offline1.sim ./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim ./test.sh -f unique/dnode/offline2.sim
./test.sh -f general/stream/metrics_del.sim ./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim ./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim ./test.sh -f general/stream/restart_stream.sim
...@@ -272,22 +234,18 @@ cd ../../../debug; make ...@@ -272,22 +234,18 @@ cd ../../../debug; make
./test.sh -f general/stream/stream_restart.sim ./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_del.sim ./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_replica1_vnoden.sim ./test.sh -f general/stream/table_replica1_vnoden.sim
./test.sh -f general/connection/test_old_data.sim ./test.sh -f general/connection/test_old_data.sim
./test.sh -f unique/dnode/datatrans_3node.sim ./test.sh -f unique/dnode/datatrans_3node.sim
./test.sh -f unique/dnode/datatrans_3node_2.sim ./test.sh -f unique/dnode/datatrans_3node_2.sim
./test.sh -f general/db/alter_tables_d2.sim ./test.sh -f general/db/alter_tables_d2.sim
./test.sh -f general/db/alter_tables_v1.sim ./test.sh -f general/db/alter_tables_v1.sim
./test.sh -f general/db/alter_tables_v4.sim ./test.sh -f general/db/alter_tables_v4.sim
#======================b5-end=============== #======================b5-end===============
#======================b6-start=============== #======================b6-start===============
./test.sh -f unique/dnode/reason.sim ./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim ./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim ./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim ./test.sh -f unique/dnode/vnode_clean.sim
./test.sh -f unique/db/commit.sim ./test.sh -f unique/db/commit.sim
./test.sh -f unique/db/delete.sim ./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete_part.sim ./test.sh -f unique/db/delete_part.sim
...@@ -298,14 +256,12 @@ cd ../../../debug; make ...@@ -298,14 +256,12 @@ cd ../../../debug; make
./test.sh -f unique/db/replica_reduce32.sim ./test.sh -f unique/db/replica_reduce32.sim
./test.sh -f unique/db/replica_reduce31.sim ./test.sh -f unique/db/replica_reduce31.sim
./test.sh -f unique/db/replica_part.sim ./test.sh -f unique/db/replica_part.sim
./test.sh -f unique/vnode/many.sim ./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim ./test.sh -f unique/vnode/replica2_basic2.sim
./test.sh -f unique/vnode/replica2_repeat.sim ./test.sh -f unique/vnode/replica2_repeat.sim
./test.sh -f unique/vnode/replica3_basic.sim ./test.sh -f unique/vnode/replica3_basic.sim
./test.sh -f unique/vnode/replica3_repeat.sim ./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim ./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f unique/dnode/monitor.sim ./test.sh -f unique/dnode/monitor.sim
./test.sh -f unique/dnode/monitor_bug.sim ./test.sh -f unique/dnode/monitor_bug.sim
./test.sh -f unique/dnode/simple.sim ./test.sh -f unique/dnode/simple.sim
...@@ -315,7 +271,6 @@ cd ../../../debug; make ...@@ -315,7 +271,6 @@ cd ../../../debug; make
./test.sh -f unique/dnode/offline3.sim ./test.sh -f unique/dnode/offline3.sim
./test.sh -f general/wal/kill.sim ./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim ./test.sh -f general/wal/maxtables.sim
./test.sh -f general/import/basic.sim ./test.sh -f general/import/basic.sim
./test.sh -f general/import/commit.sim ./test.sh -f general/import/commit.sim
./test.sh -f general/import/large.sim ./test.sh -f general/import/large.sim
...@@ -323,10 +278,8 @@ cd ../../../debug; make ...@@ -323,10 +278,8 @@ cd ../../../debug; make
./test.sh -f unique/cluster/balance1.sim ./test.sh -f unique/cluster/balance1.sim
./test.sh -f unique/cluster/balance2.sim ./test.sh -f unique/cluster/balance2.sim
./test.sh -f unique/cluster/balance3.sim ./test.sh -f unique/cluster/balance3.sim
#======================b6-end=============== #======================b6-end===============
#======================b7-start=============== #======================b7-start===============
./test.sh -f general/compute/avg.sim ./test.sh -f general/compute/avg.sim
./test.sh -f general/compute/bottom.sim ./test.sh -f general/compute/bottom.sim
./test.sh -f general/compute/count.sim ./test.sh -f general/compute/count.sim
...@@ -343,7 +296,6 @@ cd ../../../debug; make ...@@ -343,7 +296,6 @@ cd ../../../debug; make
./test.sh -f general/compute/stddev.sim ./test.sh -f general/compute/stddev.sim
./test.sh -f general/compute/sum.sim ./test.sh -f general/compute/sum.sim
./test.sh -f general/compute/top.sim ./test.sh -f general/compute/top.sim
./test.sh -f general/db/alter_option.sim ./test.sh -f general/db/alter_option.sim
./test.sh -f general/db/alter_vgroups.sim ./test.sh -f general/db/alter_vgroups.sim
./test.sh -f general/db/basic.sim ./test.sh -f general/db/basic.sim
...@@ -392,7 +344,6 @@ cd ../../../debug; make ...@@ -392,7 +344,6 @@ cd ../../../debug; make
./test.sh -f general/table/tinyint.sim ./test.sh -f general/table/tinyint.sim
./test.sh -f general/table/vgroup.sim ./test.sh -f general/table/vgroup.sim
./test.sh -f general/table/createmulti.sim ./test.sh -f general/table/createmulti.sim
./test.sh -f unique/mnode/mgmt20.sim ./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim ./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim ./test.sh -f unique/mnode/mgmt22.sim
...@@ -403,7 +354,6 @@ cd ../../../debug; make ...@@ -403,7 +354,6 @@ cd ../../../debug; make
./test.sh -f unique/mnode/mgmt33.sim ./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim ./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim ./test.sh -f unique/mnode/mgmtr2.sim
#./test.sh -f unique/arbitrator/insert_duplicationTs.sim #./test.sh -f unique/arbitrator/insert_duplicationTs.sim
./test.sh -f general/parser/join_manyblocks.sim ./test.sh -f general/parser/join_manyblocks.sim
./test.sh -f general/parser/stableOp.sim ./test.sh -f general/parser/stableOp.sim
...@@ -415,9 +365,7 @@ cd ../../../debug; make ...@@ -415,9 +365,7 @@ cd ../../../debug; make
./test.sh -f general/parser/last_cache.sim ./test.sh -f general/parser/last_cache.sim
./test.sh -f unique/big/balance.sim ./test.sh -f unique/big/balance.sim
./test.sh -f general/parser/nestquery.sim ./test.sh -f general/parser/nestquery.sim
./test.sh -f general/parser/udf.sim ./test.sh -f general/parser/udf.sim
./test.sh -f general/parser/udf_dll.sim ./test.sh -f general/parser/udf_dll.sim
./test.sh -f general/parser/udf_dll_stable.sim ./test.sh -f general/parser/udf_dll_stable.sim
#======================b7-end===============
#======================b7-end=============== \ No newline at end of file
...@@ -51,7 +51,52 @@ function dohavecore(){ ...@@ -51,7 +51,52 @@ function dohavecore(){
fi fi
fi fi
} }
function runSimCaseOneByOnefq {
end=`sed -n '$=' jenkins/basic.txt`
for ((i=1;i<=$end;i++)) ; do
if [[ $(($i%$1)) -eq $3 ]];then
line=`sed -n "$i"p jenkins/basic.txt`
if [[ $line =~ ^./test.sh* ]] || [[ $line =~ ^run* ]]; then
case=`echo $line | grep sim$ |awk '{print $NF}'`
start_time=`date +%s`
date +%F\ %T | tee -a out.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
echo -n $case
./test.sh -f $case > case.log 2>&1 && \
( grep -q 'script.*'$case'.*failed.*, err.*lineNum' ../../../sim/tsim/log/taoslog0.0 && echo -e "${RED} failed${NC}" | tee -a out.log || echo -e "${GREEN} success${NC}" | tee -a out.log )|| \
( grep -q 'script.*success.*m$' ../../../sim/tsim/log/taoslog0.0 && echo -e "${GREEN} success${NC}" | tee -a out.log ) || \
( echo -e "${RED} failed${NC}" | tee -a out.log && echo '=====================log=====================' && cat case.log )
else
echo -n $case
./test.sh -f $case > ../../sim/case.log 2>&1 && \
( grep -q 'script.*'$case'.*failed.*, err.*lineNum' ../../sim/tsim/log/taoslog0.0 && echo -e "${RED} failed${NC}" | tee -a out.log || echo -e "${GREEN} success${NC}" | tee -a out.log )|| \
( grep -q 'script.*success.*m$' ../../sim/tsim/log/taoslog0.0 && echo -e "${GREEN} success${NC}" | tee -a out.log ) || \
( echo -e "${RED} failed${NC}" | tee -a out.log && echo '=====================log=====================' && cat case.log )
fi
out_log=`tail -1 out.log `
if [[ $out_log =~ 'failed' ]];then
rm case.log
if [[ "$tests_dir" == *"$IN_TDINTERNAL"* ]]; then
cp -r ../../../sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S"`
else
cp -r ../../sim ~/sim_`date "+%Y_%m_%d_%H:%M:%S" `
fi
dohavecore $2 1
if [[ $2 == 1 ]];then
exit 8
fi
fi
end_time=`date +%s`
echo execution time of $case was `expr $end_time - $start_time`s. | tee -a out.log
dohavecore $2 1
fi
fi
done
rm -rf ../../../sim/case.log
rm -rf ../../sim/case.log
}
function runPyCaseOneByOne { function runPyCaseOneByOne {
while read -r line; do while read -r line; do
...@@ -124,11 +169,9 @@ function runPyCaseOneByOnefq() { ...@@ -124,11 +169,9 @@ function runPyCaseOneByOnefq() {
else else
echo $line echo $line
if [[ $line =~ ^bash.* ]]; then if [[ $line =~ ^bash.* ]]; then
# $line > case.log 2>&1 || cat case.log && exit 8
# cat case.log
$line > case.log 2>&1 $line > case.log 2>&1
cat case.log
if [ $? -ne 0 ];then if [ $? -ne 0 ];then
cat case.log
exit 8 exit 8
fi fi
fi fi
...@@ -175,7 +218,6 @@ if [ "${OS}" == "Linux" ]; then ...@@ -175,7 +218,6 @@ if [ "${OS}" == "Linux" ]; then
fi fi
echo "### run Python test case ###"
cd $tests_dir cd $tests_dir
...@@ -206,8 +248,13 @@ if [ "$1" == "full" ]; then ...@@ -206,8 +248,13 @@ if [ "$1" == "full" ]; then
runPyCaseOneByOne fulltest-other.sh runPyCaseOneByOne fulltest-other.sh
runPyCaseOneByOne fulltest-insert.sh runPyCaseOneByOne fulltest-insert.sh
runPyCaseOneByOne fulltest-connector.sh runPyCaseOneByOne fulltest-connector.sh
elif [ "$1" == "sim" ]; then
echo "### run sim $2 test ###"
cd $tests_dir/script
runSimCaseOneByOnefq $2 1 $3
else else
echo "### run $1 $2 test ###" echo "### run $1 $2 test ###"
if [ "$1" != "query" ] && [ "$1" != "taosAdapter" ] && [ "$1" != "other" ] && [ "$1" != "tools" ] && [ "$1" != "insert" ] && [ "$1" != "connector" ] ;then if [ "$1" != "query" ] && [ "$1" != "taosAdapter" ] && [ "$1" != "other" ] && [ "$1" != "tools" ] && [ "$1" != "insert" ] && [ "$1" != "connector" ] ;then
echo " wrong option:$1 must one of [query,other,tools,insert,connector,taosAdapter]" echo " wrong option:$1 must one of [query,other,tools,insert,connector,taosAdapter]"
exit 8 exit 8
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册