From fef23f6eac38b54baeed0b9579c6a4a931523dd9 Mon Sep 17 00:00:00 2001 From: tomchon Date: Wed, 19 May 2021 20:16:00 +0800 Subject: [PATCH] testcase-modify sub --- .../subInsertdataMaxsql100.json | 2 +- .../tools/taosdemoAllTest/subLzInsert.json | 44 +++++++++++++++++ .../pytest/tools/taosdemoAllTest/subStb2.json | 24 ++++++++++ .../taosdemoAllTest/subSyncKeepStart.json | 47 +++++++++++++++++++ .../taosdemoAllTest/subSyncMaxsql100.json | 2 +- .../taosdemoTestSubWithJson.py | 10 +++- 6 files changed, 125 insertions(+), 4 deletions(-) create mode 100644 tests/pytest/tools/taosdemoAllTest/subLzInsert.json create mode 100644 tests/pytest/tools/taosdemoAllTest/subStb2.json create mode 100644 tests/pytest/tools/taosdemoAllTest/subSyncKeepStart.json diff --git a/tests/pytest/tools/taosdemoAllTest/subInsertdataMaxsql100.json b/tests/pytest/tools/taosdemoAllTest/subInsertdataMaxsql100.json index d4bae6b274..be93792c21 100644 --- a/tests/pytest/tools/taosdemoAllTest/subInsertdataMaxsql100.json +++ b/tests/pytest/tools/taosdemoAllTest/subInsertdataMaxsql100.json @@ -41,7 +41,7 @@ "batch_create_tbl_num": 1000, "data_source": "rand", "insert_mode": "taosc", - "insert_rows": 10, + "insert_rows": 20, "childtable_limit": 0, "childtable_offset": 0, "interlace_rows": 0, diff --git a/tests/pytest/tools/taosdemoAllTest/subLzInsert.json b/tests/pytest/tools/taosdemoAllTest/subLzInsert.json new file mode 100644 index 0000000000..415e0c461f --- /dev/null +++ b/tests/pytest/tools/taosdemoAllTest/subLzInsert.json @@ -0,0 +1,44 @@ +{ + "filetype": "insert", + "cfgdir": "/etc/taos", + "host": "node1", + "port": 6030, + "user": "root", + "password": "taosdata", + "thread_count": 4, + "thread_count_create_tbl": 4, + "num_of_records_per_req": 10000, + "result_file": "insert_stb1.txt", + "confirm_parameter_prompt": "no", + "databases": [{ + "dbinfo": { + "name": "dy", + "drop": "yes" + }, + "super_tables": [{ + "name": "stb2", + "child_table_exists": "no", + "childtable_count": 100, + "childtable_prefix": "t2_", + "auto_create_table": "no", + "batch_create_tbl_num": 500, + "data_source": "rand", + "insert_mode": "taosc", + "insert_interval": 0, + "insert_rows": 20, + "interlace_rows": 0, + "childtable_limit": 10000, + "childtable_offset": 1, + "max_sql_len": 1048576, + "disorder_ratio": 0, + "disorder_range": 1000, + "timestamp_step": 1000, + "start_timestamp": "now", + "sample_format": "", + "sample_file": "", + "tags_file": "", + "columns": [{"type": "DOUBLE","count":1},{"type": "TIMESTAMP","count":1},{"type": "SMALLINT","count":2}], + "tags": [{"type": "INT","count":1},{"type": "BINARY","len": 32,"count":11},{"type": "NCHAR","len": 64,"count":4}] + }] + }] +} \ No newline at end of file diff --git a/tests/pytest/tools/taosdemoAllTest/subStb2.json b/tests/pytest/tools/taosdemoAllTest/subStb2.json new file mode 100644 index 0000000000..73c175837f --- /dev/null +++ b/tests/pytest/tools/taosdemoAllTest/subStb2.json @@ -0,0 +1,24 @@ +{ + "filetype":"subscribe", + "cfgdir": "/etc/taos", + "host": "node1", + "port": 6030, + "user": "root", + "password": "taosdata", + "databases": "dy", + "confirm_parameter_prompt": "no", + "specified_table_query": + { + "concurrent":1, + "mode":"sync", + "interval": 0, + "restart":"no", + "keepProgress":"no", + "sqls": [ + { + "sql": "select * from stb2 where ts>'2021-01-01 09:35:00.000' ;", + "result": "./sub_stb2.txt" + }] + } + + } \ No newline at end of file diff --git a/tests/pytest/tools/taosdemoAllTest/subSyncKeepStart.json b/tests/pytest/tools/taosdemoAllTest/subSyncKeepStart.json new file mode 100644 index 0000000000..431f7f52d8 --- /dev/null +++ b/tests/pytest/tools/taosdemoAllTest/subSyncKeepStart.json @@ -0,0 +1,47 @@ +{ + "filetype":"subscribe", + "cfgdir": "/etc/taos", + "host": "127.0.0.1", + "port": 6030, + "user": "root", + "password": "taosdata", + "databases": "db", + "confirm_parameter_prompt": "no", + "specified_table_query": + { + "concurrent":2, + "mode":"sync", + "interval":0, + "restartAfterConsume":0, + "restart":"yes", + "keepProgress":"yes", + "sqls": [ + { + "sql": "select * from stb00_0", + "result": "./subscribe_res0.txt" + }, + { + "sql": "select ts from stb00_1", + "result": "./subscribe_res1.txt" + }] + }, + "super_table_query": + { + "stblname": "stb0", + "threads":2, + "mode":"sync", + "interval":10000, + "restartAfterConsume":0, + "restart":"yes", + "keepProgress":"yes", + "sqls": [ + { + "sql": "select * from xxxx where ts >= '2021-02-25 10:00:01.000' ", + "result": "./subscribe_res2.txt" + }, + { + "sql": "select * from xxxx where ts > '2021-02-25 10:00:04.000' ", + "result": "./subscribe_res3.txt" + }] + } + } \ No newline at end of file diff --git a/tests/pytest/tools/taosdemoAllTest/subSyncMaxsql100.json b/tests/pytest/tools/taosdemoAllTest/subSyncMaxsql100.json index a3d7910844..40703246df 100644 --- a/tests/pytest/tools/taosdemoAllTest/subSyncMaxsql100.json +++ b/tests/pytest/tools/taosdemoAllTest/subSyncMaxsql100.json @@ -11,7 +11,7 @@ { "concurrent":2, "mode":"sync", - "interval":10000, + "interval":0, "restart":"no", "keepProgress":"no", "sqls": [ diff --git a/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py b/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py index 3af68134be..f09be03834 100644 --- a/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py +++ b/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py @@ -113,8 +113,14 @@ class TDTestCase: # query times less than or equal to 100 os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath) - # os.system("%staosdemo -f tools/taosdemoAllTest/subSyncMaxsql100.json" % binPath) - os.system("%staosdemo -f tools/taosdemoAllTest/subSupermaxsql100.json" % binPath) + os.system("%staosdemo -f tools/taosdemoAllTest/subSyncMaxsql100.json" % binPath) + # os.system("%staosdemo -f tools/taosdemoAllTest/subSupermaxsql100.json" % binPath) + # os.system("%staosdemo -f tools/taosdemoAllTest/subSupermaxsql100.json" % binPath) + + # os.system("%staosdemo -f tools/taosdemoAllTest/subLzInsert.json" % binPath) + # os.system("%staosdemo -f tools/taosdemoAllTest/subStb2.json" % binPath) + + # delete useless files -- GitLab