fix:[TS-5776]add test case

This commit is contained in:
wangmm0220 2025-02-19 11:12:13 +08:00
parent 0291024ff2
commit fc3995a10c
6 changed files with 15 additions and 48 deletions

View File

@ -3002,8 +3002,8 @@ enum {
#define DEFAULT_MAX_POLL_INTERVAL 300000 #define DEFAULT_MAX_POLL_INTERVAL 300000
#define DEFAULT_SESSION_TIMEOUT 12000 #define DEFAULT_SESSION_TIMEOUT 12000
#define DEFAULT_MAX_POLL_WAIT_TIME 500 #define DEFAULT_MAX_POLL_WAIT_TIME 1000
#define DEFAULT_MIN_POLL_ROWS 500 #define DEFAULT_MIN_POLL_ROWS 4096
typedef struct { typedef struct {
char name[TSDB_TOPIC_FNAME_LEN]; // accout.topic char name[TSDB_TOPIC_FNAME_LEN]; // accout.topic

View File

@ -218,7 +218,7 @@ int32_t tqScanData(STQ* pTq, STqHandle* pHandle, SMqDataRsp* pRsp, STqOffsetVal*
pRsp->blockNum++; pRsp->blockNum++;
totalRows += pDataBlock->info.rows; totalRows += pDataBlock->info.rows;
if (totalRows >= pRequest->minPollRows || (taosGetTimestampMs() - st >pRequest->timeout)) { if (totalRows >= pRequest->minPollRows || (taosGetTimestampMs() - st > pRequest->timeout)) {
break; break;
} }
} }

View File

@ -321,7 +321,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqMaxGroupIds.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqMaxGroupIds.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsumeDiscontinuousData.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsumeDiscontinuousData.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqOffset.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqOffset.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_primary_key.py #,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_primary_key.py
,,n,system-test,python3 ./test.py -f 7-tmq/tmqDropConsumer.py ,,n,system-test,python3 ./test.py -f 7-tmq/tmqDropConsumer.py

View File

@ -170,7 +170,7 @@
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqMaxGroupIds.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqMaxGroupIds.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsumeDiscontinuousData.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqConsumeDiscontinuousData.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqOffset.py ,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmqOffset.py
,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_primary_key.py #,,y,system-test,./pytest.sh python3 ./test.py -f 7-tmq/tmq_primary_key.py
,,n,system-test,python3 ./test.py -f 7-tmq/tmqDropConsumer.py ,,n,system-test,python3 ./test.py -f 7-tmq/tmqDropConsumer.py

View File

@ -18,10 +18,19 @@ import datetime
sys.path.append("./7-tmq") sys.path.append("./7-tmq")
from tmqCommon import * from tmqCommon import *
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
"td.connect.pass": "taosdata",
"auto.offset.reset": "earliest",
"enable.auto.commit": "false",
"experimental.snapshot.enable": "true",
"min.poll.rows": "1"
}
class TDTestCase: class TDTestCase:
clientCfgDict = {'debugFlag': 135} clientCfgDict = {'debugFlag': 135}
updatecfgDict = {'debugFlag': 135, 'asynclog': 0, 'tmqRowSize':1} updatecfgDict = {'debugFlag': 135, 'asynclog': 0}
updatecfgDict["clientCfg"] = clientCfgDict updatecfgDict["clientCfg"] = clientCfgDict
def init(self, conn, logSql, replicaVar=1): def init(self, conn, logSql, replicaVar=1):
@ -44,16 +53,7 @@ class TDTestCase:
tdSql.execute(f'create topic topic_pk_query as select * from pk') tdSql.execute(f'create topic topic_pk_query as select * from pk')
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
"td.connect.pass": "taosdata",
"auto.offset.reset": "earliest",
"enable.auto.commit": "false",
"experimental.snapshot.enable": "true",
}
consumer = Consumer(consumer_dict) consumer = Consumer(consumer_dict)
try: try:
consumer.subscribe(["topic_pk_query"]) consumer.subscribe(["topic_pk_query"])
except TmqError: except TmqError:
@ -156,14 +156,6 @@ class TDTestCase:
tdSql.execute(f'create topic topic_pk_stable as stable pks') tdSql.execute(f'create topic topic_pk_stable as stable pks')
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
"td.connect.pass": "taosdata",
"auto.offset.reset": "earliest",
"enable.auto.commit": "false",
"experimental.snapshot.enable": "true",
}
consumer = Consumer(consumer_dict) consumer = Consumer(consumer_dict)
try: try:
@ -266,14 +258,6 @@ class TDTestCase:
tdSql.execute(f'create topic topic_in with meta as database abc1') tdSql.execute(f'create topic topic_in with meta as database abc1')
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
"td.connect.pass": "taosdata",
"auto.offset.reset": "earliest",
"enable.auto.commit": "false",
"experimental.snapshot.enable": "true",
}
consumer = Consumer(consumer_dict) consumer = Consumer(consumer_dict)
try: try:
@ -376,14 +360,6 @@ class TDTestCase:
tdSql.execute(f'create topic topic_pk_string with meta as database db_pk_string') tdSql.execute(f'create topic topic_pk_string with meta as database db_pk_string')
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
"td.connect.pass": "taosdata",
"auto.offset.reset": "earliest",
"enable.auto.commit": "false",
"experimental.snapshot.enable": "true",
}
consumer = Consumer(consumer_dict) consumer = Consumer(consumer_dict)
try: try:
@ -485,14 +461,6 @@ class TDTestCase:
tdSql.execute(f'create topic topic_pk_query_30755 as select * from pk') tdSql.execute(f'create topic topic_pk_query_30755 as select * from pk')
consumer_dict = {
"group.id": "g1",
"td.connect.user": "root",
"td.connect.pass": "taosdata",
"auto.offset.reset": "earliest",
"enable.auto.commit": "false",
"experimental.snapshot.enable": "true",
}
consumer = Consumer(consumer_dict) consumer = Consumer(consumer_dict)
try: try:

View File

@ -90,7 +90,6 @@ python3 ./test.py -f 7-tmq/tmqParamsTest.py -R
python3 ./test.py -f 7-tmq/tmqMaxGroupIds.py python3 ./test.py -f 7-tmq/tmqMaxGroupIds.py
python3 ./test.py -f 7-tmq/tmqConsumeDiscontinuousData.py python3 ./test.py -f 7-tmq/tmqConsumeDiscontinuousData.py
python3 ./test.py -f 7-tmq/tmqOffset.py python3 ./test.py -f 7-tmq/tmqOffset.py
python3 ./test.py -f 7-tmq/tmq_primary_key.py
python3 ./test.py -f 7-tmq/tmqDropConsumer.py python3 ./test.py -f 7-tmq/tmqDropConsumer.py
python3 ./test.py -f 1-insert/insert_stb.py python3 ./test.py -f 1-insert/insert_stb.py
python3 ./test.py -f 1-insert/delete_stable.py python3 ./test.py -f 1-insert/delete_stable.py