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

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

......@@ -8,6 +8,7 @@ def skipbuild = 0
def win_stop = 0
def scope = []
def mod = [0,1,2,3,4]
def sim_mod = [0,1,2,3]
def abortPreviousBuilds() {
def currentJobName = env.JOB_NAME
......@@ -54,10 +55,10 @@ def pre_test(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -86,10 +87,10 @@ def pre_test(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -129,10 +130,10 @@ def pre_test_noinstall(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -161,10 +162,10 @@ def pre_test_noinstall(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -201,10 +202,10 @@ def pre_test_mac(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WKC}
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -233,10 +234,10 @@ def pre_test_mac(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
sh '''
cd ${WK}
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -279,10 +280,10 @@ def pre_test_win(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
bat '''
cd C:\\workspace\\TDinternal\\community
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -310,10 +311,10 @@ def pre_test_win(){
git checkout master
'''
}
else if(env.CHANGE_TARGET == '2.4'){
else if(env.CHANGE_TARGET == '2.0'){
bat '''
cd C:\\workspace\\TDinternal
git checkout 2.4
git checkout 2.0
'''
}
else{
......@@ -382,7 +383,9 @@ pipeline {
temp = (gitlog =~ /\((.*?)\)/)
temp = temp[0].remove(1)
scope = temp.split(",")
scope = ['connector','query','insert','other','tools','taosAdapter']
Collections.shuffle mod
Collections.shuffle sim_mod
}
}
......@@ -400,10 +403,10 @@ pipeline {
}
parallel {
stage('python_1') {
agent{label " slave1 || slave6 || slave11 || slave16 "}
agent{label " slave1 || slave11 "}
steps {
pre_test()
timeout(time: 55, unit: 'MINUTES'){
timeout(time: 100, unit: 'MINUTES'){
script{
scope.each {
sh """
......@@ -417,10 +420,10 @@ pipeline {
}
}
stage('python_2') {
agent{label " slave2 || slave7 || slave12 || slave17 "}
agent{label " slave2 || slave12 "}
steps {
pre_test()
timeout(time: 55, unit: 'MINUTES'){
timeout(time: 100, unit: 'MINUTES'){
script{
scope.each {
sh """
......@@ -434,7 +437,7 @@ pipeline {
}
}
stage('python_3') {
agent{label " slave3 || slave8 || slave13 ||slave18 "}
agent{label " slave3 || slave13 "}
steps {
timeout(time: 105, unit: 'MINUTES'){
pre_test()
......@@ -451,9 +454,9 @@ pipeline {
}
}
stage('python_4') {
agent{label " slave4 || slave9 || slave14 || slave19 "}
agent{label " slave4 || slave14 "}
steps {
timeout(time: 55, unit: 'MINUTES'){
timeout(time: 100, unit: 'MINUTES'){
pre_test()
script{
scope.each {
......@@ -469,9 +472,9 @@ pipeline {
}
}
stage('python_5') {
agent{label " slave5 || slave10 || slave15 || slave20 "}
agent{label " slave5 || slave15 "}
steps {
timeout(time: 55, unit: 'MINUTES'){
timeout(time: 100, unit: 'MINUTES'){
pre_test()
script{
scope.each {
......@@ -486,35 +489,98 @@ pipeline {
}
}
}
stage('arm64centos7') {
agent{label " arm64centos7 "}
stage('sim_1') {
agent{label " slave6 || slave16 "}
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') {
agent{label " arm64centos8 "}
stage('sim_2') {
agent{label " slave7 || slave17 "}
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') {
agent{label " arm32bionic "}
stage('sim_3') {
agent{label " slave8 || slave18 "}
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') {
agent{label " arm64bionic "}
stage('sim_4') {
agent{label " slave9 || slave19 "}
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') {
agent{label " arm64focal "}
stage('other') {
agent{label " slave10 || slave20 "}
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') {
agent{label " centos7 "}
......@@ -546,12 +612,41 @@ pipeline {
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'){
agent{label " wintest "}
steps {
pre_test()
script{
script{
while(win_stop == 0){
sleep(1)
}
......@@ -561,6 +656,7 @@ pipeline {
stage('test'){
agent{label "win"}
steps{
catchError(buildResult: 'FAILURE', stageResult: 'FAILURE') {
pre_test_win()
timeout(time: 20, unit: 'MINUTES'){
......@@ -569,7 +665,7 @@ pipeline {
.\\test-all.bat wintest
'''
}
}
}
script{
win_stop=1
}
......
......@@ -902,7 +902,7 @@ SSDataBlock* doGlobalAggregate(void* param, bool* newgroup) {
// not belongs to the same group, return the result of current group;
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
for(int32_t j = 0; j < pOperator->numOfOutput; ++j) {
......@@ -954,7 +954,7 @@ SSDataBlock* doGlobalAggregate(void* param, bool* newgroup) {
// not belongs to the same group, return the result of current group
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);
savePrevOrderColumns(pAggInfo->currentGroupColData, pAggInfo->groupColumnList, pBlock, 0, &pAggInfo->hasGroupColData);
......
......@@ -1866,6 +1866,7 @@ int tscProcessRetrieveGlobalMergeRsp(SSqlObj *pSql) {
bool convertJson = true;
if (pQueryInfo->isStddev == true) convertJson = false;
convertQueryResult(pRes, pQueryInfo, pSql->self, true, convertJson);
pRes->code = pQueryInfo->pQInfo->code;
code = pRes->code;
if (pRes->code == TSDB_CODE_SUCCESS) {
......
Subproject commit dd78bfff5549c08153798719c1707ab441b5f4ab
Subproject commit 59f00a69f36b08cea86a70a22c29b2c27ef506ae
......@@ -171,7 +171,6 @@ static void monSaveSystemInfo();
static void monSaveClusterInfo();
static void monSaveDnodesInfo();
static void monSaveVgroupsInfo();
static void monSaveSlowQueryInfo();
static void monSaveDisksInfo();
static void monSaveGrantsInfo();
static void monSaveHttpReqInfo();
......@@ -321,7 +320,6 @@ static void *monThreadFunc(void *param) {
monSaveClusterInfo();
}
monSaveVgroupsInfo();
monSaveSlowQueryInfo();
monSaveDisksInfo();
monSaveGrantsInfo();
monSaveHttpReqInfo();
......@@ -383,9 +381,9 @@ static void monBuildMonitorSql(char *sql, int32_t cmd) {
tsMonitorDbName, TSDB_DEFAULT_USER);
} else if (cmd == MON_CMD_CREATE_TB_SLOWQUERY) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.slowquery(ts timestamp, query_id "
"binary(%d), username binary(%d), qid binary(%d), created_time timestamp, time bigint, end_point binary(%d), sql binary(%d))",
tsMonitorDbName, QUERY_ID_LEN, TSDB_TABLE_FNAME_LEN - 1, QUERY_ID_LEN, TSDB_EP_LEN, TSDB_SLOW_QUERY_SQL_LEN);
"create table if not exists %s.slowquery(ts timestamp, username "
"binary(%d), created_time timestamp, time bigint, sql binary(%d))",
tsMonitorDbName, TSDB_TABLE_FNAME_LEN - 1, TSDB_SLOW_QUERY_SQL_LEN);
} else if (cmd == MON_CMD_CREATE_TB_LOG) {
snprintf(sql, SQL_LENGTH,
"create table if not exists %s.log(ts timestamp, level tinyint, "
......@@ -1213,91 +1211,6 @@ static void monSaveVgroupsInfo() {
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() {
int64_t ts = taosGetTimestampUs();
char * sql = tsMonitor.sql;
......
......@@ -659,7 +659,7 @@ void* doDestroyFilterInfo(SSingleColumnFilterInfo* pFilterInfo, int32_t numOfFil
void setInputDataBlock(SOperatorInfo* pOperator, SQLFunctionCtx* pCtx, SSDataBlock* pBlock, int32_t order);
int32_t getNumOfResult(SQueryRuntimeEnv *pRuntimeEnv, SQLFunctionCtx* pCtx, int32_t numOfOutput);
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 copyTsColoum(SSDataBlock* pRes, SQLFunctionCtx* pCtx, int32_t numOfOutput);
......
......@@ -1432,7 +1432,7 @@ static void doWindowBorderInterpolation(SOperatorInfo* pOperatorInfo, SSDataBloc
int32_t step = GET_FORWARD_DIRECTION_FACTOR(pQueryAttr->order.order);
if (pBlock->pDataBlock == NULL){
tscError("pBlock->pDataBlock == NULL");
qError("window border interpolation: pBlock->pDataBlock == NULL");
return;
}
SColumnInfoData *pColInfo = taosArrayGet(pBlock->pDataBlock, 0);
......@@ -3586,7 +3586,7 @@ void setDefaultOutputBuf(SQueryRuntimeEnv *pRuntimeEnv, SOptrBasicInfo *pInfo, i
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;
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
for(int32_t i = 0; i < pDataBlock->info.numOfCols; ++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) {
pColInfo->pData = p;
......@@ -3602,7 +3602,10 @@ void updateOutputBuf(SOptrBasicInfo* pBInfo, int32_t *bufCapacity, int32_t numOf
pBInfo->pCtx[i].pOutput = pColInfo->pData;
(*bufCapacity) = newSize;
} 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
for (int32_t i = 0; i < pDataBlock->info.numOfCols; ++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.
int32_t functionId = pBInfo->pCtx[i].functionId;
......@@ -5767,7 +5770,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again
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);
if (pTableQueryInfo != NULL) {
......@@ -5833,7 +5836,7 @@ static SSDataBlock* doProjectOperation(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again
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);
if (pTableQueryInfo != NULL) {
......@@ -6330,7 +6333,7 @@ static void doTimeEveryImpl(SOperatorInfo* pOperator, SQLFunctionCtx *pCtx, SSDa
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) {
pRes->info.rows = 0;
if (!pEveryInfo->groupDone) {
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0);
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0, pOperator->pRuntimeEnv);
doTimeEveryImpl(pOperator, pInfo->pCtx, pEveryInfo->lastBlock, false);
if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) {
copyTsColoum(pRes, pInfo->pCtx, pOperator->numOfOutput);
......@@ -6386,7 +6389,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again
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);
if (pEveryInfo->groupDone && pOperator->upstream[0]->notify) {
......@@ -6412,7 +6415,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
if (!pEveryInfo->groupDone) {
pEveryInfo->allDone = true;
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0);
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0, pOperator->pRuntimeEnv);
doTimeEveryImpl(pOperator, pInfo->pCtx, NULL, false);
if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) {
break;
......@@ -6433,7 +6436,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
// Return result of the previous group in the firstly.
if (*newgroup) {
if (!pEveryInfo->groupDone) {
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0);
updateOutputBuf(&pEveryInfo->binfo, &pEveryInfo->bufCapacity, 0, pOperator->pRuntimeEnv);
doTimeEveryImpl(pOperator, pInfo->pCtx, NULL, false);
if (pRes->info.rows >= pRuntimeEnv->resultInfo.threshold) {
pEveryInfo->existDataBlock = pBlock;
......@@ -6469,7 +6472,7 @@ static SSDataBlock* doTimeEvery(void* param, bool* newgroup) {
// the pDataBlock are always the same one, no need to call this again
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;
......
#!/bin/bash
ulimit -c unlimited
#======================p1-start===============
python3 testCompress.py
python3 testNoCompress.py
python3 ./test.py -f import_merge/importBlock1HO.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/merge_commit_data-0.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
ulimit -c unlimited
#======================p1-start===============
#python3 ./test.py -f dbmgmt/database-name-boundary.py
python3 test.py -f dbmgmt/nanoSecondCheck.py
#
python3 ./test.py -f tsdb/tsdbComp.py
# user
python3 ./test.py -f user/user_create.py
python3 ./test.py -f user/pass_len.py
#======================p1-end===============
#======================p2-start===============
# perfbenchmark
python3 ./test.py -f perfbenchmark/bug3433.py
#python3 ./test.py -f perfbenchmark/bug3589.py
#python3 ./test.py -f perfbenchmark/taosdemoInsert.py
#alter table
python3 ./test.py -f alter/alter_table_crash.py
python3 ./test.py -f alter/alterTabAddTagWithNULL.py
python3 ./test.py -f alter/alterTimestampColDataProcess.py
#======================p2-end===============
#======================p3-start===============
python3 ./test.py -f alter/alter_table.py
python3 ./test.py -f alter/alter_debugFlag.py
python3 ./test.py -f alter/alter_keep.py
python3 ./test.py -f alter/alter_cacheLastRow.py
python3 ./test.py -f alter/alter_create_exception.py
python3 ./test.py -f alter/alterColMultiTimes.py
#======================p3-end===============
#======================p4-start===============
python3 ./test.py -f account/account_create.py
# client
python3 ./test.py -f client/client.py
python3 ./test.py -f client/version.py
......@@ -50,12 +39,10 @@ python3 ./test.py -f client/taoshellCheckCase.py
# python3 ./test.py -f client/change_time_1_2.py
python3 client/twoClients.py
python3 testMinTablesPerVnode.py
# topic
python3 ./test.py -f topic/topicQuery.py
#======================p4-end===============
#======================p5-start===============
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
#======================p5-end===============
#======================p5-end===============
\ No newline at end of file
#!/bin/bash
ulimit -c unlimited
#======================p1-start===============
# timezone
python3 ./test.py -f TimeZone/TestCaseTimeZone.py
#stable
python3 ./test.py -f stable/insert.py
python3 ./test.py -f stable/query_after_reset.py
#table
python3 ./test.py -f table/alter_wal0.py
python3 ./test.py -f table/column_name.py
......@@ -22,7 +19,6 @@ python3 ./test.py -f table/boundary.py
#python3 ./test.py -f table/create.py
python3 ./test.py -f table/del_stable.py
python3 ./test.py -f table/create_db_from_normal_db.py
# tag
python3 ./test.py -f tag_lite/filter.py
python3 ./test.py -f tag_lite/create-tags-boundary.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.py
python3 ./test.py -f tag_lite/change.py
#======================p1-end===============
#======================p2-start===============
python3 ./test.py -f tag_lite/column.py
python3 ./test.py -f tag_lite/commit.py
python3 ./test.py -f tag_lite/create.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/drop_auto_create.py
python3 ./test.py -f tag_lite/json_tag_extra.py
#======================p2-end===============
#======================p3-start===============
#query
python3 ./test.py -f query/distinctOneColTb.py
python3 ./test.py -f query/filter.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/queryStateWindow.py
# python3 ./test.py -f query/nestedQuery/queryWithOrderLimit.py
#======================p3-end===============
#======================p4-start===============
python3 ./test.py -f query/nestquery_last_row.py
python3 ./test.py -f query/nestedQuery/nestedQuery.py
python3 ./test.py -f query/nestedQuery/nestedQuery_datacheck.py
......@@ -145,7 +135,6 @@ python3 ./test.py -f query/query.py
python3 ./test.py -f query/queryDiffColsTagsAndOr.py
python3 ./test.py -f query/queryGroupTbname.py
python3 ./test.py -f query/queryRegex.py
#stream
python3 ./test.py -f stream/metric_1.py
python3 ./test.py -f stream/metric_n.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/showStreamExecTimeisNull.py
python3 ./test.py -f stream/cqSupportBefore1970.py
python3 ./test.py -f query/queryGroupbyWithInterval.py
python3 queryCount.py
# subscribe
python3 test.py -f subscribe/singlemeter.py
#python3 test.py -f subscribe/stability.py
python3 test.py -f subscribe/supertable.py
#======================p4-end===============
#======================p5-start===============
# functions
python3 ./test.py -f functions/all_null_value.py
python3 ./test.py -f functions/function_avg.py -r 1
......@@ -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_percentile2.py
python3 ./test.py -f functions/variable_httpDbNameMandatory.py
######## 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
#======================p5-end===============
#======================p5-end===============
\ No newline at end of file
......@@ -12,7 +12,7 @@
# -*- coding: utf-8 -*-
import sys
import os
import os, time
from util.log import *
from util.cases import *
from util.sql import *
......@@ -107,6 +107,7 @@ class TDTestCase:
# insert by csv files and timetamp is long int , strings in ts and
# cols
os.system(
"%staosBenchmark -f tools/taosdemoAllTest/NanoTestCase/taosdemoTestNanoDatabasecsv.json -y " %
binPath)
......@@ -117,9 +118,11 @@ class TDTestCase:
tdSql.checkData(0, 0, 10000)
tdSql.query("describe stb0")
tdSql.checkDataType(3, 1, "TIMESTAMP")
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.query("select count(*) from stb0 where ts < 1626918583000000000")
tdSql.checkData(0, 0, 10000)
......@@ -134,31 +137,9 @@ class TDTestCase:
binPath)
tdSql.query("select count(*) from test.meters")
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 ./*.py.sql")
os.system("rm -rf ./taosdemoTestNanoCreateDB.sql")
def stop(self):
tdSql.close()
......
......@@ -56,7 +56,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "INT"}],
"tags": [{"type": "INT", "count":1}]
"tags": [{"type": "INT", "count":6}]
},
{
"name": "stb1",
......@@ -81,8 +81,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "TINYINT", "count":1}],
"tags": [{"type": "TINYINT", "count":1}]
"columns": [{"type": "TINYINT", "count":6}],
"tags": [{"type": "TINYINT", "count":6}]
},
{
"name": "stb2",
......@@ -108,7 +108,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
"tags": [{"type": "BIGINT", "count":1}]
"tags": [{"type": "BIGINT", "count":6}]
},
{
"name": "stb3",
......@@ -134,7 +134,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
"tags": [{"type": "SMALLINT", "count":1}]
"tags": [{"type": "SMALLINT", "count":6}]
},
{
"name": "stb4",
......@@ -160,7 +160,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
"tags": [{"type": "FLOAT", "count":1}]
"tags": [{"type": "FLOAT", "count":6}]
},
{
"name": "stb5",
......@@ -186,7 +186,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
"tags": [{"type": "DOUBLE", "count":1}]
"tags": [{"type": "DOUBLE", "count":6}]
},
{
"name": "stb6",
......@@ -212,7 +212,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UINT"}],
"tags": [{"type": "UINT", "count":1}]
"tags": [{"type": "UINT", "count":6}]
},
{
"name": "stb7",
......@@ -237,8 +237,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "BOOL"}],
"tags": [{"type": "BOOL", "count":1}]
"columns": [ {"type": "INT"}],
"tags": [{"type": "INT", "count":3}]
},
{
"name": "stb8",
......@@ -263,8 +263,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "NCHAR","len": 16, "count":1}],
"tags": [{"type": "NCHAR", "count":1}]
"columns": [{"type": "NCHAR","len": 16, "count":6}],
"tags": [{"type": "NCHAR", "count":6}]
},
{
"name": "stb9",
......@@ -289,8 +289,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BINARY", "len": 16, "count":1}],
"tags": [{"type": "BINARY", "count":1}]
"columns": [{"type": "BINARY", "len": 16, "count":6}],
"tags": [{"type": "BINARY", "count":6}]
},
{
"name": "stb10",
......@@ -316,7 +316,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UBIGINT"}],
"tags": [{"type": "UBIGINT", "count":1}]
"tags": [{"type": "UBIGINT", "count":6}]
},
{
"name": "stb11",
......@@ -342,7 +342,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UTINYINT"}],
"tags": [{"type": "UTINYINT", "count":1}]
"tags": [{"type": "UTINYINT", "count":3}]
},
{
"name": "stb12",
......@@ -368,7 +368,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "USMALLINT"}],
"tags": [{"type": "USMALLINT", "count":1}]
"tags": [{"type": "USMALLINT", "count":6}]
}]
}]
}
......@@ -56,7 +56,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "INT"}],
"tags": [{"type": "INT", "count":1}]
"tags": [{"type": "INT", "count":6}]
},
{
"name": "stb1",
......@@ -82,7 +82,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UINT"}],
"tags": [{"type": "UINT", "count":1}]
"tags": [{"type": "UINT", "count":6}]
},
{
"name": "stb2",
......@@ -107,8 +107,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "TINYINT", "count":1}],
"tags": [{"type": "TINYINT", "count":1}]
"columns": [{"type": "TINYINT", "count":6}],
"tags": [{"type": "TINYINT", "count":6}]
},
{
"name": "stb3",
......@@ -134,7 +134,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BIGINT"}],
"tags": [{"type": "BIGINT", "count":1}]
"tags": [{"type": "BIGINT", "count":6}]
},
{
"name": "stb4",
......@@ -160,7 +160,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "SMALLINT"}],
"tags": [{"type": "SMALLINT", "count":1}]
"tags": [{"type": "SMALLINT", "count":6}]
},
{
"name": "stb5",
......@@ -186,7 +186,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "FLOAT"}],
"tags": [{"type": "FLOAT", "count":1}]
"tags": [{"type": "FLOAT", "count":6}]
},
{
"name": "stb6",
......@@ -212,7 +212,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "DOUBLE"}],
"tags": [{"type": "DOUBLE", "count":1}]
"tags": [{"type": "DOUBLE", "count":6}]
},
{
"name": "stb7",
......@@ -237,8 +237,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "BOOL"}],
"tags": [{"type": "BOOL", "count":1}]
"columns": [ {"type": "int"}],
"tags": [{"type": "int", "count":6}]
},
{
"name": "stb8",
......@@ -263,8 +263,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "NCHAR","len": 16, "count":1}],
"tags": [{"type": "NCHAR", "count":1}]
"columns": [{"type": "NCHAR","len": 16, "count":6}],
"tags": [{"type": "NCHAR", "count":6}]
},
{
"name": "stb9",
......@@ -289,8 +289,8 @@
"sample_format": "csv",
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "BINARY", "len": 16, "count":1}],
"tags": [{"type": "BINARY", "count":1}]
"columns": [{"type": "BINARY", "len": 16, "count":6}],
"tags": [{"type": "BINARY", "count":6}]
},
{
"name": "stb10",
......@@ -316,7 +316,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UBIGINT"}],
"tags": [{"type": "UBIGINT", "count":1}]
"tags": [{"type": "UBIGINT", "count":6}]
},
{
"name": "stb11",
......@@ -342,7 +342,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [{"type": "UTINYINT"}],
"tags": [{"type": "UTINYINT", "count":1}]
"tags": [{"type": "UTINYINT", "count":6}]
},
{
"name": "stb12",
......@@ -368,7 +368,7 @@
"sample_file": "./sample.csv",
"tags_file": "",
"columns": [ {"type": "USMALLINT"}],
"tags": [{"type": "USMALLINT", "count":1}]
"tags": [{"type": "USMALLINT", "count":6}]
}]
}]
}
......@@ -268,16 +268,16 @@ class TDTestCase:
tdSql.checkData(0, 0, 10)
# insert: sample json
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
tdSql.execute("use dbtest123")
tdSql.query("select c2 from stb0")
tdSql.checkData(0, 0, 2147483647)
tdSql.query("select * from stb1 where t1=-127")
tdSql.checkRows(20)
tdSql.query("select * from stb1 where t2=127")
tdSql.checkRows(10)
tdSql.query("select * from stb1 where t2=126")
tdSql.checkRows(10)
#os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-sample-stmt.json -y " % binPath)
#tdSql.execute("use dbtest123")
#tdSql.query("select c2 from stb0")
#tdSql.checkData(0, 0, 2147483647)
#tdSql.query("select * from stb1 where t1=-127")
#tdSql.checkRows(20)
#tdSql.query("select * from stb1 where t2=127")
#tdSql.checkRows(10)
#tdSql.query("select * from stb1 where t2=126")
#tdSql.checkRows(10)
# insert: test interlace parament
os.system("%staosBenchmark -f tools/taosdemoAllTest/stmt/insert-interlace-row-stmt.json -y " % binPath)
......
......@@ -27,6 +27,7 @@ class TDTestCase:
self.ts = 1601481600000
self.numberOfTables = 1
self.numberOfRecords = 15000
self.tmpdir = "tmp"
def getBuildPath(self):
selfPath = os.path.dirname(os.path.realpath(__file__))
......@@ -67,16 +68,22 @@ class TDTestCase:
tdLog.info("taosdump found in %s" % buildPath)
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(
"%staosdump --databases db -o /tmp -B 16384 -L 1048576" %
binPath)
"%staosdump --databases db -o %s -B 16384 " %
(binPath, self.tmpdir))
tdSql.execute("drop database db")
tdSql.query("show databases")
tdSql.checkRows(0)
os.system("%staosdump -i /tmp" % binPath)
os.system("%staosdump -i %s" % (binPath, self.tmpdir))
tdSql.query("show databases")
tdSql.checkRows(1)
......
cd ../../../debug; cmake ..
cd ../../../debug; make
#======================b1-start===============
./test.sh -f general/field/2.sim
./test.sh -f general/field/3.sim
./test.sh -f general/field/4.sim
......@@ -14,8 +12,6 @@ cd ../../../debug; make
./test.sh -f general/field/single.sim
./test.sh -f general/field/smallint.sim
./test.sh -f general/field/tinyint.sim
# ./test.sh -f general/http/autocreate.sim
# ./test.sh -f general/http/chunked.sim
# ./test.sh -f general/http/gzip.sim
......@@ -27,7 +23,6 @@ cd ../../../debug; make
# ./test.sh -f general/http/telegraf.sim
# ./test.sh -f general/http/grafana_bug.sim
# ./test.sh -f general/http/grafana.sim
./test.sh -f general/insert/basic.sim
./test.sh -f general/insert/insert_drop.sim
./test.sh -f general/insert/query_block1_memory.sim
......@@ -37,7 +32,6 @@ cd ../../../debug; make
./test.sh -f general/insert/query_file_memory.sim
./test.sh -f general/insert/query_multi_file.sim
./test.sh -f general/insert/tcp.sim
./test.sh -f general/parser/alter.sim
./test.sh -f general/parser/alter1.sim
./test.sh -f general/parser/alter_stable.sim
......@@ -90,30 +84,22 @@ cd ../../../debug; make
./test.sh -f general/db/nosuchfile.sim
./test.sh -f general/parser/function.sim
./test.sh -f unique/cluster/vgroup100.sim
# ./test.sh -f unique/http/admin.sim
# ./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim
./test.sh -f general/alter/cached_schema_after_alter.sim
#======================b1-end===============
#======================b2-start===============
#./test.sh -f general/wal/sync.sim
./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim
./test.sh -f general/user/authority.sim
./test.sh -f general/user/monitor.sim
./test.sh -f general/user/pass_alter.sim
./test.sh -f general/user/pass_len.sim
./test.sh -f general/user/user_create.sim
./test.sh -f general/user/user_len.sim
./test.sh -f general/vector/metrics_field.sim
./test.sh -f general/vector/metrics_mix.sim
./test.sh -f general/vector/metrics_query.sim
......@@ -125,7 +111,6 @@ cd ../../../debug; make
./test.sh -f general/vector/table_mix.sim
./test.sh -f general/vector/table_query.sim
./test.sh -f general/vector/table_time.sim
./test.sh -f unique/account/account_create.sim
./test.sh -f unique/account/account_delete.sim
./test.sh -f unique/account/account_len.sim
......@@ -137,24 +122,17 @@ cd ../../../debug; make
./test.sh -f unique/account/usage.sim
./test.sh -f unique/account/user_create.sim
./test.sh -f unique/account/user_len.sim
./test.sh -f unique/big/maxvnodes.sim
./test.sh -f unique/big/tcp.sim
./test.sh -f unique/cluster/alter.sim
./test.sh -f unique/cluster/cache.sim
#./test.sh -f unique/http/admin.sim
#./test.sh -f unique/http/opentsdb.sim
./test.sh -f unique/import/replica2.sim
./test.sh -f unique/import/replica3.sim
./test.sh -f general/alter/cached_schema_after_alter.sim
#======================b2-end===============
#======================b3-start===============
./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/dn3_mn1_full_createTableFail.sim
......@@ -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_vnode_nomaster.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_alterTag_online.sim
./test.sh -f unique/arbitrator/offline_replica2_createTable_online.sim
......@@ -189,19 +166,16 @@ cd ../../../debug; make
./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_drop.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_replica3_alterTable_add.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_dropTable.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_stopAll_starAll.sim
./test.sh -f unique/migrate/mn2_vn2_repl2_rmVnodeDir.sim
./test.sh -f unique/stable/balance_replica1.sim
./test.sh -f unique/stable/dnode2_stop.sim
./test.sh -f unique/stable/dnode2.sim
......@@ -210,11 +184,8 @@ cd ../../../debug; make
./test.sh -f unique/stable/replica2_vnode3.sim
./test.sh -f unique/stable/replica3_dnode6.sim
./test.sh -f unique/stable/replica3_vnode3.sim
#======================b3-end===============
#======================b4-start===============
./test.sh -f general/alter/count.sim
./test.sh -f general/alter/dnode.sim
./test.sh -f general/alter/import.sim
......@@ -222,22 +193,17 @@ cd ../../../debug; make
./test.sh -f general/alter/insert2.sim
./test.sh -f general/alter/metrics.sim
./test.sh -f general/alter/table.sim
./test.sh -f general/cache/new_metrics.sim
./test.sh -f general/cache/restart_metrics.sim
./test.sh -f general/cache/restart_table.sim
./test.sh -f general/connection/connection.sim
./test.sh -f general/column/commit.sim
./test.sh -f general/column/metrics.sim
./test.sh -f general/column/table.sim
./test.sh -f general/compress/commitlog.sim
./test.sh -f general/compress/compress.sim
./test.sh -f general/compress/compress2.sim
./test.sh -f general/compress/uncompress.sim
./test.sh -f general/stable/disk.sim
./test.sh -f general/stable/dnode3.sim
./test.sh -f general/stable/metrics.sim
......@@ -245,7 +211,6 @@ cd ../../../debug; make
./test.sh -f general/stable/show.sim
./test.sh -f general/stable/values.sim
./test.sh -f general/stable/vnode3.sim
./test.sh -f unique/column/replica3.sim
./test.sh -f issue/TD-2713.sim
./test.sh -f general/parser/select_distinct_tag.sim
......@@ -253,10 +218,8 @@ cd ../../../debug; make
./test.sh -f issue/TD-2677.sim
./test.sh -f issue/TD-2680.sim
./test.sh -f unique/dnode/lossdata.sim
#======================b4-end===============
#======================b5-start===============
./test.sh -f unique/dnode/alternativeRole.sim
./test.sh -f unique/dnode/balance1.sim
./test.sh -f unique/dnode/balance2.sim
......@@ -264,7 +227,6 @@ cd ../../../debug; make
./test.sh -f unique/dnode/balancex.sim
./test.sh -f unique/dnode/offline1.sim
./test.sh -f unique/dnode/offline2.sim
./test.sh -f general/stream/metrics_del.sim
./test.sh -f general/stream/metrics_replica1_vnoden.sim
./test.sh -f general/stream/restart_stream.sim
......@@ -272,22 +234,18 @@ cd ../../../debug; make
./test.sh -f general/stream/stream_restart.sim
./test.sh -f general/stream/table_del.sim
./test.sh -f general/stream/table_replica1_vnoden.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_2.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_v4.sim
#======================b5-end===============
#======================b6-start===============
./test.sh -f unique/dnode/reason.sim
./test.sh -f unique/dnode/remove1.sim
./test.sh -f unique/dnode/remove2.sim
./test.sh -f unique/dnode/vnode_clean.sim
./test.sh -f unique/db/commit.sim
./test.sh -f unique/db/delete.sim
./test.sh -f unique/db/delete_part.sim
......@@ -298,14 +256,12 @@ cd ../../../debug; make
./test.sh -f unique/db/replica_reduce32.sim
./test.sh -f unique/db/replica_reduce31.sim
./test.sh -f unique/db/replica_part.sim
./test.sh -f unique/vnode/many.sim
./test.sh -f unique/vnode/replica2_basic2.sim
./test.sh -f unique/vnode/replica2_repeat.sim
./test.sh -f unique/vnode/replica3_basic.sim
./test.sh -f unique/vnode/replica3_repeat.sim
./test.sh -f unique/vnode/replica3_vgroup.sim
./test.sh -f unique/dnode/monitor.sim
./test.sh -f unique/dnode/monitor_bug.sim
./test.sh -f unique/dnode/simple.sim
......@@ -315,7 +271,6 @@ cd ../../../debug; make
./test.sh -f unique/dnode/offline3.sim
./test.sh -f general/wal/kill.sim
./test.sh -f general/wal/maxtables.sim
./test.sh -f general/import/basic.sim
./test.sh -f general/import/commit.sim
./test.sh -f general/import/large.sim
......@@ -323,10 +278,8 @@ cd ../../../debug; make
./test.sh -f unique/cluster/balance1.sim
./test.sh -f unique/cluster/balance2.sim
./test.sh -f unique/cluster/balance3.sim
#======================b6-end===============
#======================b7-start===============
./test.sh -f general/compute/avg.sim
./test.sh -f general/compute/bottom.sim
./test.sh -f general/compute/count.sim
......@@ -343,7 +296,6 @@ cd ../../../debug; make
./test.sh -f general/compute/stddev.sim
./test.sh -f general/compute/sum.sim
./test.sh -f general/compute/top.sim
./test.sh -f general/db/alter_option.sim
./test.sh -f general/db/alter_vgroups.sim
./test.sh -f general/db/basic.sim
......@@ -392,7 +344,6 @@ cd ../../../debug; make
./test.sh -f general/table/tinyint.sim
./test.sh -f general/table/vgroup.sim
./test.sh -f general/table/createmulti.sim
./test.sh -f unique/mnode/mgmt20.sim
./test.sh -f unique/mnode/mgmt21.sim
./test.sh -f unique/mnode/mgmt22.sim
......@@ -403,7 +354,6 @@ cd ../../../debug; make
./test.sh -f unique/mnode/mgmt33.sim
./test.sh -f unique/mnode/mgmt34.sim
./test.sh -f unique/mnode/mgmtr2.sim
#./test.sh -f unique/arbitrator/insert_duplicationTs.sim
./test.sh -f general/parser/join_manyblocks.sim
./test.sh -f general/parser/stableOp.sim
......@@ -415,9 +365,7 @@ cd ../../../debug; make
./test.sh -f general/parser/last_cache.sim
./test.sh -f unique/big/balance.sim
./test.sh -f general/parser/nestquery.sim
./test.sh -f general/parser/udf.sim
./test.sh -f general/parser/udf_dll.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(){
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 {
while read -r line; do
......@@ -124,11 +169,9 @@ function runPyCaseOneByOnefq() {
else
echo $line
if [[ $line =~ ^bash.* ]]; then
# $line > case.log 2>&1 || cat case.log && exit 8
# cat case.log
$line > case.log 2>&1
cat case.log
if [ $? -ne 0 ];then
cat case.log
exit 8
fi
fi
......@@ -175,7 +218,6 @@ if [ "${OS}" == "Linux" ]; then
fi
echo "### run Python test case ###"
cd $tests_dir
......@@ -206,8 +248,13 @@ if [ "$1" == "full" ]; then
runPyCaseOneByOne fulltest-other.sh
runPyCaseOneByOne fulltest-insert.sh
runPyCaseOneByOne fulltest-connector.sh
elif [ "$1" == "sim" ]; then
echo "### run sim $2 test ###"
cd $tests_dir/script
runSimCaseOneByOnefq $2 1 $3
else
echo "### run $1 $2 test ###"
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]"
exit 8
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册