From bcfb8b1fe1636fe0daf524c1bfaa75058c1dfe12 Mon Sep 17 00:00:00 2001 From: tomchon Date: Fri, 25 Jun 2021 16:49:47 +0800 Subject: [PATCH] [TD-4369]: add testcase of resubscibe and json file --- .../subSyncResubAC1endAfter1.json | 0 .../subSyncResubAC1endAfterMin1.json | 0 .../subSyncResubACMinus1.json | 0 .../subSyncResubACMinus1endAfter0.json | 0 .../subSyncResubACMinus1endAfterNo0.json | 0 .../taosdemoAllTest/subSyncResFileNull.json | 49 +++++++++++++++++++ .../taosdemoTestSubWithJson.py | 12 ++++- 7 files changed, 59 insertions(+), 2 deletions(-) rename tests/pytest/tools/taosdemoAllTest/{subResubjson => Resubjson}/subSyncResubAC1endAfter1.json (100%) rename tests/pytest/tools/taosdemoAllTest/{subResubjson => Resubjson}/subSyncResubAC1endAfterMin1.json (100%) rename tests/pytest/tools/taosdemoAllTest/{subResubjson => Resubjson}/subSyncResubACMinus1.json (100%) rename tests/pytest/tools/taosdemoAllTest/{subResubjson => Resubjson}/subSyncResubACMinus1endAfter0.json (100%) rename tests/pytest/tools/taosdemoAllTest/{subResubjson => Resubjson}/subSyncResubACMinus1endAfterNo0.json (100%) create mode 100644 tests/pytest/tools/taosdemoAllTest/subSyncResFileNull.json diff --git a/tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubAC1endAfter1.json b/tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubAC1endAfter1.json similarity index 100% rename from tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubAC1endAfter1.json rename to tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubAC1endAfter1.json diff --git a/tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubAC1endAfterMin1.json b/tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubAC1endAfterMin1.json similarity index 100% rename from tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubAC1endAfterMin1.json rename to tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubAC1endAfterMin1.json diff --git a/tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1.json b/tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1.json similarity index 100% rename from tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1.json rename to tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1.json diff --git a/tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1endAfter0.json b/tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1endAfter0.json similarity index 100% rename from tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1endAfter0.json rename to tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1endAfter0.json diff --git a/tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1endAfterNo0.json b/tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1endAfterNo0.json similarity index 100% rename from tests/pytest/tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1endAfterNo0.json rename to tests/pytest/tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1endAfterNo0.json diff --git a/tests/pytest/tools/taosdemoAllTest/subSyncResFileNull.json b/tests/pytest/tools/taosdemoAllTest/subSyncResFileNull.json new file mode 100644 index 0000000000..625e4792cf --- /dev/null +++ b/tests/pytest/tools/taosdemoAllTest/subSyncResFileNull.json @@ -0,0 +1,49 @@ +{ + "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, + "restart":"no", + "keepProgress":"no", + "resubAfterConsume":-1, + "endAfterConsume":1, + "sqls": [ + { + "sql": "select * from stb00_0", + "result": "" + }, + { + "sql": "select ts from stb00_1", + "result": "" + }] + }, + "super_table_query": + { + "stblname": "stb0", + "threads":2, + "mode":"sync", + "interval":10000, + "restart":"no", + "keepProgress":"no", + "resubAfterConsume":-1, + "endAfterConsume":1, + "sqls": [ + { + "sql": "select * from xxxx where ts >= '2021-02-25 10:00:01.000' ", + "result": "" + }, + { + "sql": "select * from xxxx where ts > '2021-02-25 10:00:04.000' ", + "result": "" + }] + } + } \ No newline at end of file diff --git a/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py b/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py index 848ddb3d4b..3e967581a4 100644 --- a/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py +++ b/tests/pytest/tools/taosdemoAllTest/taosdemoTestSubWithJson.py @@ -116,9 +116,17 @@ class TDTestCase: assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncSpecMaxsql100.json" % binPath) != 0 assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncSuperMaxsql100.json" % binPath) != 0 + # # result files is null + # os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath) + # os.system("%staosdemo -f tools/taosdemoAllTest/subSyncResFileNull.json" % binPath) + # # assert os.system("%staosdemo -f tools/taosdemoAllTest/subSyncResFileNull.json" % binPath) != 0 + + + + # resubAfterConsume= -1 endAfter=-1 ; os.system('kill -9 `ps aux|grep "subSyncResubACMinus1.json" |grep -v "grep"|awk \'{print $2}\'` ') - os.system("nohup %staosdemo -f tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1.json & " % binPath) + os.system("nohup %staosdemo -f tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1.json & " % binPath) sleep(2) query_pid1 = int(subprocess.getstatusoutput('ps aux|grep "subSyncResubACMinus1.json" |grep -v "grep"|awk \'{print $2}\'')[1]) print("get sub1 process'pid") @@ -138,7 +146,7 @@ class TDTestCase: # # resubAfterConsume= -1 endAfter=0 ; # os.system("%staosdemo -f tools/taosdemoAllTest/subInsertdataMaxsql100.json" % binPath) # os.system('kill -9 `ps aux|grep "subSyncResubACMinus1endAfter0.json" |grep -v "grep"|awk \'{print $2}\'` ') - # os.system("nohup %staosdemo -f tools/taosdemoAllTest/subResubjson/subSyncResubACMinus1endAfter0.json & " % binPath) + # os.system("nohup %staosdemo -f tools/taosdemoAllTest/Resubjson/subSyncResubACMinus1endAfter0.json & " % binPath) # sleep(2) # query_pid1 = int(subprocess.getstatusoutput('ps aux|grep "subSyncResubACMinus1endAfter0.json" |grep -v "grep"|awk \'{print $2}\'')[1]) # print("get sub2 process'pid") -- GitLab