Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: ignore drop/create db failure for cloud #558

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/2.x-taosbenchmark-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
sudo pkill -9 taosadapter || :
sudo pkill -9 taosd || :

for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|slow-query|mixed-query|tmq|vgroups"`; do python3 ./test.py -f $i > /dev/null && echo -e "\033[32m taosbenchmark-debug-test/$i success! \033[0m"|| echo -e "\033[31m taosbenchmark-debug-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-debug-failed.txt ;done
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|slow-query|mixed-query|tmq|vgroups|cloud"`; do python3 ./test.py -f $i > /dev/null && echo -e "\033[32m taosbenchmark-debug-test/$i success! \033[0m"|| echo -e "\033[31m taosbenchmark-debug-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-debug-failed.txt ;done

- name: Check Test Result
if: steps.changed-files-specific.outputs.any_changed == 'true'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/2.x-taosbenchmark-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ jobs:

if find taosbenchmark -name "*.py"|grep -q .;
then
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|slow-query|mixed-query|tmq|vgroups"`; do python3 ./test.py -f $i > /dev/null && echo -e "\033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e "\033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt ;done
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|slow-query|mixed-query|tmq|vgroups|cloud"`; do python3 ./test.py -f $i > /dev/null && echo -e "\033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e "\033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt ;done
fi

- name: Check Test Result
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-coveralls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-macos-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-macos-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/3.0-non-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ jobs:
apt install -y cmake build-essential git libjansson-dev libsnappy-dev liblzma-dev libz-dev zlib1g pkg-config libssl-dev > /dev/null

echo "clone TDengine 3.0 on ${{ steps.setup.outputs.uname }}"
git clone --branch 3.0 --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1

git clone --branch fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud --depth 1 https://github.com/taosdata/TDengine > /dev/null || exit 1

echo "build TDengine 3.0 on ${{ steps.setup.outputs.uname }}"
cd TDengine || exit 1
Expand Down
34 changes: 27 additions & 7 deletions .github/workflows/3.0-taosBenchmark-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if: |
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
pip3 install numpy fabric2 psutil pandas faker toml > /dev/null 2>&1
pip3 install git+https://github.com/taosdata/taos-connector-python > /dev/null

- name: Test
- name: Test native cases
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
Expand All @@ -164,10 +164,25 @@ jobs:

if find taosbenchmark -name "*.py"|grep -q .;
then
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|taosdemo|kill-slow-query"|sort`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e " \033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|taosdemo|kill-slow-query|cloud"|sort`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e " \033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done
fi

- name: Test WebSocket
- name: Test cloud cases
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
env:
TDENGINE_CLOUD_DSN: ${{ secrets.TDENGINE_CLOUD_DSN }}
run: |
cd tests

if find taosbenchmark/ -name "cloud*.py"|grep -q .;
then
for i in `find taosbenchmark -name "cloud*.py"`; do printf $i && python3 ./test.py -f $i && echo -e " \033[32m benchmark-cloud-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-cloud-test:$i failed! \033[0m" | tee -a ~/taosbenchmark-cloud-failed.txt; done
fi

- name: Test WebSocket cases
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
Expand All @@ -177,7 +192,7 @@ jobs:

if find taosbenchmark/ws -name "*.py"|grep -q .;
then
for i in `find taosbenchmark/ws -name "*.py"`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m benchmark-ws-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-ws-test:$i failed! \033[0m" | tee -a ~/benchmark-ws-failed.txt; done
for i in `find taosbenchmark/ws -name "*.py"`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m benchmark-ws-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-ws-test:$i failed! \033[0m" | tee -a ~/taosbenchmark-ws-failed.txt; done
fi

- name: Test taosdemo query
Expand Down Expand Up @@ -211,7 +226,12 @@ jobs:
exit 1
fi

if [ -f ~/benchmark-ws-failed.txt ];then
cat ~/benchmark-ws-failed.txt
if [ -f ~/taosbenchmark-cloud-failed.txt ];then
cat ~/taosbenchmark-cloud-failed.txt
exit 1
fi

if [ -f ~/taosbenchmark-ws-failed.txt ];then
cat ~/taosbenchmark-ws-failed.txt
exit 1
fi
34 changes: 27 additions & 7 deletions .github/workflows/3.0-taosBenchmark-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if: |
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
pip3 install numpy fabric2 psutil pandas faker toml > /dev/null 2>&1
pip3 install git+https://github.com/taosdata/taos-connector-python > /dev/null

- name: Test
- name: Test native cases
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
Expand All @@ -164,10 +164,25 @@ jobs:

if find taosbenchmark -name "*.py"|grep -q .;
then
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|taosdemo|kill-slow-query"|sort`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e " \033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done
for i in `find taosbenchmark -name "*.py"|grep -Ev "websocket|taosdemo|kill-slow-query|cloud"|sort`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m taosbenchmark-release-test/$i success! \033[0m"|| echo -e " \033[31m taosbenchmark-release-test/$i failed! \033[0m" | tee -a ~/taosbenchmark-release-failed.txt; done
fi

- name: Test WebSocket
- name: Test cloud cases
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
|| github.event_name == 'push'
env:
TDENGINE_CLOUD_DSN: ${{ secrets.TDENGINE_CLOUD_DSN }}
run: |
cd tests

if find taosbenchmark -name "cloud*.py"|grep -q .;
then
for i in `find taosbenchmark -name "cloud*.py"`; do printf $i && python3 ./test.py -f $i && echo -e " \033[32m benchmark-cloud-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-cloud-test:$i failed! \033[0m" | tee -a ~/taosbenchmark-cloud-failed.txt; done
fi

- name: Test WebSocket cases
if:
(steps.changed-files-specific.outputs.any_changed == 'true'
&& github.event_name == 'pull_request')
Expand All @@ -177,7 +192,7 @@ jobs:

if find taosbenchmark/ws -name "*.py"|grep -q .;
then
for i in `find taosbenchmark/ws -name "*.py"`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m benchmark-ws-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-ws-test:$i failed! \033[0m" | tee -a ~/benchmark-ws-failed.txt; done
for i in `find taosbenchmark/ws -name "*.py"`; do printf $i && python3 ./test.py -f $i > /dev/null && echo -e " \033[32m benchmark-ws-test:$i success! \033[0m"|| echo -e " \033[31m benchmark-ws-test:$i failed! \033[0m" | tee -a ~/taosbenchmark-ws-failed.txt; done
fi

- name: Test taosdemo query
Expand Down Expand Up @@ -211,7 +226,12 @@ jobs:
exit 1
fi

if [ -f ~/benchmark-ws-failed.txt ];then
cat ~/benchmark-ws-failed.txt
if [ -f ~/taosbenchmark-cloud-failed.txt ];then
cat ~/taosbenchmark-cloud-failed.txt
exit 1
fi

if [ -f ~/taosbenchmark-ws-failed.txt ];then
cat ~/taosbenchmark-ws-failed.txt
exit 1
fi
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosdump-debug.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosdump-release-ws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-taosdump-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: '3.0'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: Change time zone
if:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/3.0-windows-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
with:
repository: 'taosdata/TDengine'
path: 'TDengine'
ref: 'feat/sangshuduo/TD-21806-taosbenchmark-specify-vnodes'
ref: 'fix/sangshuduo/TD-22022-ignore-drop-failure-for-cloud'

- name: create debug directory
if: |
Expand Down
8 changes: 4 additions & 4 deletions inc/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ typedef struct SArguments_S {
int iface;
int rest_server_ver_major;
#ifdef TD_VER_COMPATIBLE_3_0_0_0
int16_t inputed_vgroups;
int16_t inputted_vgroups;
#endif
} SArguments;

Expand Down Expand Up @@ -783,11 +783,11 @@ int getServerVersionRest(int16_t rest_port);
int postProceSql(char *sqlstr, char* dbName, int precision, int iface,
int protocol, uint16_t rest_port, bool tcp,
int sockfd, char* filePath);
int queryDbExec(SBenchConn *conn, char *command);
int queryDbExecTaosc(SBenchConn *conn, char *command);
int queryDbExecRest(char *command, char* dbName, int precision,
int iface, int protocol, bool tcp, int sockfd);
SBenchConn* init_bench_conn();
void close_bench_conn(SBenchConn* conn);
SBenchConn* initBenchConn();
void closeBenchConn(SBenchConn* conn);
int regexMatch(const char *s, const char *reg, int cflags);
int convertHostToServAddr(char *host, uint16_t port,
struct sockaddr_in *serv_addr);
Expand Down
10 changes: 5 additions & 5 deletions src/benchCommandOpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ int32_t benchParseSingleOpt(int32_t key, char* arg) {
errorPrintReqArg2("taosBenchmark", "v");
}
g_arguments->nthreads_auto = false;
g_arguments->inputed_vgroups = atoi(arg);
g_arguments->inputted_vgroups = atoi(arg);
break;
#endif

Expand Down Expand Up @@ -691,7 +691,7 @@ static void initDatabase() {
benchArrayPush(g_arguments->databases, database);
database = benchArrayGet(g_arguments->databases, 0);
database->dbName = DEFAULT_DATABASE;
database->drop = 1;
database->drop = true;
database->precision = TSDB_TIME_PRECISION_MILLI;
database->sml_precision = TSDB_SML_TIMESTAMP_MILLI_SECONDS;
database->cfgs = benchArrayInit(1, sizeof(SDbCfg));
Expand Down Expand Up @@ -744,7 +744,7 @@ void init_argument() {
g_arguments->iface = TAOSC_IFACE;
g_arguments->rest_server_ver_major = -1;
#ifdef TD_VER_COMPATIBLE_3_0_0_0
g_arguments->inputed_vgroups = -1;
g_arguments->inputted_vgroups = -1;
#endif

initDatabase();
Expand Down Expand Up @@ -1040,7 +1040,7 @@ void queryAggrFunc() {
}

if (REST_IFACE != g_arguments->iface) {
pThreadInfo->conn = init_bench_conn();
pThreadInfo->conn = initBenchConn();
if (pThreadInfo->conn == NULL) {
errorPrint("%s() failed to init connection\n", __func__);
free(pThreadInfo);
Expand All @@ -1056,7 +1056,7 @@ void queryAggrFunc() {
}
pthread_join(read_id, NULL);
if (REST_IFACE != g_arguments->iface) {
close_bench_conn(pThreadInfo->conn);
closeBenchConn(pThreadInfo->conn);
} else {
destroySockFd(pThreadInfo->sockfd);
}
Expand Down
Loading