Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
e4338377
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1184
Star
22015
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
e4338377
编写于
1月 22, 2022
作者:
D
dapan1121
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feature/qnode
上级
79ce13e8
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
49 addition
and
81 deletion
+49
-81
source/libs/qworker/test/qworkerTests.cpp
source/libs/qworker/test/qworkerTests.cpp
+49
-81
未找到文件。
source/libs/qworker/test/qworkerTests.cpp
浏览文件 @
e4338377
...
@@ -40,8 +40,9 @@ namespace {
...
@@ -40,8 +40,9 @@ namespace {
#define qwtTestQueryQueueSize 1000
#define qwtTestQueryQueueSize 1000
#define qwtTestFetchQueueSize 1000
#define qwtTestFetchQueueSize 1000
#define qwtTestMaxExecTaskUsec
1000000
#define qwtTestMaxExecTaskUsec
2
uint64_t
qwtTestQueryId
=
0
;
bool
qwtTestEnableSleep
=
true
;
bool
qwtTestEnableSleep
=
true
;
bool
qwtTestStop
=
false
;
bool
qwtTestStop
=
false
;
bool
qwtTestDeadLoop
=
true
;
bool
qwtTestDeadLoop
=
true
;
...
@@ -70,14 +71,17 @@ int32_t qwtTestSinkBlockNum = 0;
...
@@ -70,14 +71,17 @@ int32_t qwtTestSinkBlockNum = 0;
int32_t
qwtTestSinkMaxBlockNum
=
0
;
int32_t
qwtTestSinkMaxBlockNum
=
0
;
bool
qwtTestSinkQueryEnd
=
false
;
bool
qwtTestSinkQueryEnd
=
false
;
SRWLatch
qwtTestSinkLock
=
0
;
SRWLatch
qwtTestSinkLock
=
0
;
int32_t
qwtTestSinkLastLen
=
0
;
SSubQueryMsg
qwtqueryMsg
=
{
0
};
SRpcMsg
qwtfetchRpc
=
{
0
};
SRpcMsg
qwtfetchRpc
=
{
0
};
SResFetchReq
qwtfetchMsg
=
{
0
};
SResFetchReq
qwtfetchMsg
=
{
0
};
SRpcMsg
qwtreadyRpc
=
{
0
};
SRpcMsg
qwtreadyRpc
=
{
0
};
SResReadyReq
qwtreadyMsg
=
{
0
};
SResReadyReq
qwtreadyMsg
=
{
0
};
SRpcMsg
qwtdropRpc
=
{
0
};
SRpcMsg
qwtdropRpc
=
{
0
};
STaskDropReq
qwtdropMsg
=
{
0
};
STaskDropReq
qwtdropMsg
=
{
0
};
SSchTasksStatusReq
qwtstatusMsg
=
{
0
};
void
qwtInitLogFile
()
{
void
qwtInitLogFile
()
{
...
@@ -96,18 +100,17 @@ void qwtInitLogFile() {
...
@@ -96,18 +100,17 @@ void qwtInitLogFile() {
}
}
void
qwtBuildQueryReqMsg
(
SRpcMsg
*
queryRpc
)
{
void
qwtBuildQueryReqMsg
(
SRpcMsg
*
queryRpc
)
{
SSubQueryMsg
*
queryMsg
=
(
SSubQueryMsg
*
)
calloc
(
1
,
sizeof
(
SSubQueryMsg
)
+
100
);
qwtqueryMsg
.
queryId
=
htobe64
(
atomic_add_fetch_64
(
&
qwtTestQueryId
,
1
));
queryMsg
->
queryId
=
htobe64
(
1
);
qwtqueryMsg
.
sId
=
htobe64
(
1
);
queryMsg
->
sId
=
htobe64
(
1
);
qwtqueryMsg
.
taskId
=
htobe64
(
1
);
queryMsg
->
taskId
=
htobe64
(
1
);
qwtqueryMsg
.
contentLen
=
htonl
(
100
);
queryMsg
->
contentLen
=
htonl
(
100
);
queryRpc
->
pCont
=
&
qwtqueryMsg
;
queryRpc
->
pCont
=
queryMsg
;
queryRpc
->
contLen
=
sizeof
(
SSubQueryMsg
)
+
100
;
queryRpc
->
contLen
=
sizeof
(
SSubQueryMsg
)
+
100
;
}
}
void
qwtBuildReadyReqMsg
(
SResReadyReq
*
readyMsg
,
SRpcMsg
*
readyRpc
)
{
void
qwtBuildReadyReqMsg
(
SResReadyReq
*
readyMsg
,
SRpcMsg
*
readyRpc
)
{
readyMsg
->
sId
=
htobe64
(
1
);
readyMsg
->
sId
=
htobe64
(
1
);
readyMsg
->
queryId
=
htobe64
(
1
);
readyMsg
->
queryId
=
htobe64
(
atomic_load_64
(
&
qwtTestQueryId
)
);
readyMsg
->
taskId
=
htobe64
(
1
);
readyMsg
->
taskId
=
htobe64
(
1
);
readyRpc
->
pCont
=
readyMsg
;
readyRpc
->
pCont
=
readyMsg
;
readyRpc
->
contLen
=
sizeof
(
SResReadyReq
);
readyRpc
->
contLen
=
sizeof
(
SResReadyReq
);
...
@@ -115,7 +118,7 @@ void qwtBuildReadyReqMsg(SResReadyReq *readyMsg, SRpcMsg *readyRpc) {
...
@@ -115,7 +118,7 @@ void qwtBuildReadyReqMsg(SResReadyReq *readyMsg, SRpcMsg *readyRpc) {
void
qwtBuildFetchReqMsg
(
SResFetchReq
*
fetchMsg
,
SRpcMsg
*
fetchRpc
)
{
void
qwtBuildFetchReqMsg
(
SResFetchReq
*
fetchMsg
,
SRpcMsg
*
fetchRpc
)
{
fetchMsg
->
sId
=
htobe64
(
1
);
fetchMsg
->
sId
=
htobe64
(
1
);
fetchMsg
->
queryId
=
htobe64
(
1
);
fetchMsg
->
queryId
=
htobe64
(
atomic_load_64
(
&
qwtTestQueryId
)
);
fetchMsg
->
taskId
=
htobe64
(
1
);
fetchMsg
->
taskId
=
htobe64
(
1
);
fetchRpc
->
pCont
=
fetchMsg
;
fetchRpc
->
pCont
=
fetchMsg
;
fetchRpc
->
contLen
=
sizeof
(
SResFetchReq
);
fetchRpc
->
contLen
=
sizeof
(
SResFetchReq
);
...
@@ -123,7 +126,7 @@ void qwtBuildFetchReqMsg(SResFetchReq *fetchMsg, SRpcMsg *fetchRpc) {
...
@@ -123,7 +126,7 @@ void qwtBuildFetchReqMsg(SResFetchReq *fetchMsg, SRpcMsg *fetchRpc) {
void
qwtBuildDropReqMsg
(
STaskDropReq
*
dropMsg
,
SRpcMsg
*
dropRpc
)
{
void
qwtBuildDropReqMsg
(
STaskDropReq
*
dropMsg
,
SRpcMsg
*
dropRpc
)
{
dropMsg
->
sId
=
htobe64
(
1
);
dropMsg
->
sId
=
htobe64
(
1
);
dropMsg
->
queryId
=
htobe64
(
1
);
dropMsg
->
queryId
=
htobe64
(
atomic_load_64
(
&
qwtTestQueryId
)
);
dropMsg
->
taskId
=
htobe64
(
1
);
dropMsg
->
taskId
=
htobe64
(
1
);
dropRpc
->
pCont
=
dropMsg
;
dropRpc
->
pCont
=
dropMsg
;
dropRpc
->
contLen
=
sizeof
(
STaskDropReq
);
dropRpc
->
contLen
=
sizeof
(
STaskDropReq
);
...
@@ -273,7 +276,8 @@ int32_t qwtExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t *useconds) {
...
@@ -273,7 +276,8 @@ int32_t qwtExecTask(qTaskInfo_t tinfo, SSDataBlock** pRes, uint64_t *useconds) {
if
(
endExec
)
{
if
(
endExec
)
{
usleep
(
rand
()
%
qwtTestMaxExecTaskUsec
);
usleep
(
rand
()
%
qwtTestMaxExecTaskUsec
);
*
pRes
=
(
SSDataBlock
*
)
0x1
;
*
pRes
=
(
SSDataBlock
*
)
calloc
(
1
,
sizeof
(
SSDataBlock
));
(
*
pRes
)
->
info
.
rows
=
rand
()
%
1000
;
}
else
{
}
else
{
*
pRes
=
NULL
;
*
pRes
=
NULL
;
usleep
(
rand
()
%
qwtTestMaxExecTaskUsec
);
usleep
(
rand
()
%
qwtTestMaxExecTaskUsec
);
...
@@ -297,6 +301,8 @@ int32_t qwtPutDataBlock(DataSinkHandle handle, const SInputData* pInput, bool* p
...
@@ -297,6 +301,8 @@ int32_t qwtPutDataBlock(DataSinkHandle handle, const SInputData* pInput, bool* p
assert
(
0
);
assert
(
0
);
}
}
free
((
void
*
)
pInput
->
pData
);
taosWLockLatch
(
&
qwtTestSinkLock
);
taosWLockLatch
(
&
qwtTestSinkLock
);
qwtTestSinkBlockNum
++
;
qwtTestSinkBlockNum
++
;
...
@@ -339,6 +345,7 @@ void qwtGetDataLength(DataSinkHandle handle, int32_t* pLen, bool* pQueryEnd) {
...
@@ -339,6 +345,7 @@ void qwtGetDataLength(DataSinkHandle handle, int32_t* pLen, bool* pQueryEnd) {
}
else
{
}
else
{
*
pLen
=
0
;
*
pLen
=
0
;
}
}
qwtTestSinkLastLen
=
*
pLen
;
taosWUnLockLatch
(
&
qwtTestSinkLock
);
taosWUnLockLatch
(
&
qwtTestSinkLock
);
*
pQueryEnd
=
qwtTestSinkQueryEnd
;
*
pQueryEnd
=
qwtTestSinkQueryEnd
;
...
@@ -348,11 +355,23 @@ void qwtGetDataLength(DataSinkHandle handle, int32_t* pLen, bool* pQueryEnd) {
...
@@ -348,11 +355,23 @@ void qwtGetDataLength(DataSinkHandle handle, int32_t* pLen, bool* pQueryEnd) {
int32_t
qwtGetDataBlock
(
DataSinkHandle
handle
,
SOutputData
*
pOutput
)
{
int32_t
qwtGetDataBlock
(
DataSinkHandle
handle
,
SOutputData
*
pOutput
)
{
taosWLockLatch
(
&
qwtTestSinkLock
);
taosWLockLatch
(
&
qwtTestSinkLock
);
if
(
qwtTestSinkBlockNum
>
0
)
{
if
(
qwtTestSinkLastLen
>
0
)
{
qwtTestSinkBlockNum
--
;
pOutput
->
numOfRows
=
rand
()
%
10
+
1
;
pOutput
->
numOfRows
=
rand
()
%
10
+
1
;
pOutput
->
compressed
=
1
;
pOutput
->
compressed
=
1
;
pOutput
->
pData
=
(
char
*
)
malloc
(
pOutput
->
numOfRows
);
pOutput
->
queryEnd
=
qwtTestSinkQueryEnd
;
if
(
qwtTestSinkBlockNum
==
0
)
{
pOutput
->
bufStatus
=
DS_BUF_EMPTY
;
}
else
if
(
qwtTestSinkBlockNum
<=
qwtTestSinkMaxBlockNum
*
0.5
)
{
pOutput
->
bufStatus
=
DS_BUF_LOW
;
}
else
{
pOutput
->
bufStatus
=
DS_BUF_FULL
;
}
pOutput
->
useconds
=
rand
()
%
10
+
1
;
pOutput
->
precision
=
1
;
}
else
if
(
qwtTestSinkLastLen
==
0
)
{
pOutput
->
numOfRows
=
0
;
pOutput
->
compressed
=
1
;
pOutput
->
pData
=
NULL
;
pOutput
->
queryEnd
=
qwtTestSinkQueryEnd
;
pOutput
->
queryEnd
=
qwtTestSinkQueryEnd
;
if
(
qwtTestSinkBlockNum
==
0
)
{
if
(
qwtTestSinkBlockNum
==
0
)
{
pOutput
->
bufStatus
=
DS_BUF_EMPTY
;
pOutput
->
bufStatus
=
DS_BUF_EMPTY
;
...
@@ -534,7 +553,6 @@ void *queryThread(void *param) {
...
@@ -534,7 +553,6 @@ void *queryThread(void *param) {
while
(
!
qwtTestStop
)
{
while
(
!
qwtTestStop
)
{
qwtBuildQueryReqMsg
(
&
queryRpc
);
qwtBuildQueryReqMsg
(
&
queryRpc
);
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
free
(
queryRpc
.
pCont
);
if
(
qwtTestEnableSleep
)
{
if
(
qwtTestEnableSleep
)
{
usleep
(
rand
()
%
5
);
usleep
(
rand
()
%
5
);
}
}
...
@@ -654,8 +672,6 @@ void *clientThread(void *param) {
...
@@ -654,8 +672,6 @@ void *clientThread(void *param) {
usleep
(
1
);
usleep
(
1
);
}
}
free
(
queryRpc
.
pCont
);
if
(
qwtTestEnableSleep
)
{
if
(
qwtTestEnableSleep
)
{
usleep
(
rand
()
%
5
);
usleep
(
rand
()
%
5
);
}
}
...
@@ -763,41 +779,11 @@ TEST(seqTest, normalCase) {
...
@@ -763,41 +779,11 @@ TEST(seqTest, normalCase) {
SRpcMsg
statusRpc
=
{
0
};
SRpcMsg
statusRpc
=
{
0
};
qwtInitLogFile
();
qwtInitLogFile
();
SSubQueryMsg
*
queryMsg
=
(
SSubQueryMsg
*
)
calloc
(
1
,
sizeof
(
SSubQueryMsg
)
+
100
);
queryMsg
->
queryId
=
htobe64
(
1
);
queryMsg
->
sId
=
htobe64
(
1
);
queryMsg
->
taskId
=
htobe64
(
1
);
queryMsg
->
contentLen
=
htonl
(
100
);
queryRpc
.
pCont
=
queryMsg
;
queryRpc
.
contLen
=
sizeof
(
SSubQueryMsg
)
+
100
;
SResReadyReq
readyMsg
=
{
0
};
readyMsg
.
sId
=
htobe64
(
1
);
readyMsg
.
queryId
=
htobe64
(
1
);
readyMsg
.
taskId
=
htobe64
(
1
);
readyRpc
.
pCont
=
&
readyMsg
;
readyRpc
.
contLen
=
sizeof
(
SResReadyReq
);
SResFetchReq
fetchMsg
=
{
0
};
qwtBuildQueryReqMsg
(
&
queryRpc
);
fetchMsg
.
sId
=
htobe64
(
1
);
qwtBuildReadyReqMsg
(
&
qwtreadyMsg
,
&
readyRpc
);
fetchMsg
.
queryId
=
htobe64
(
1
);
qwtBuildFetchReqMsg
(
&
qwtfetchMsg
,
&
fetchRpc
);
fetchMsg
.
taskId
=
htobe64
(
1
);
qwtBuildDropReqMsg
(
&
qwtdropMsg
,
&
dropRpc
);
fetchRpc
.
pCont
=
&
fetchMsg
;
fetchRpc
.
contLen
=
sizeof
(
SResFetchReq
);
STaskDropReq
dropMsg
=
{
0
};
dropMsg
.
sId
=
htobe64
(
1
);
dropMsg
.
queryId
=
htobe64
(
1
);
dropMsg
.
taskId
=
htobe64
(
1
);
dropRpc
.
pCont
=
&
dropMsg
;
dropRpc
.
contLen
=
sizeof
(
STaskDropReq
);
SSchTasksStatusReq
statusMsg
=
{
0
};
statusMsg
.
sId
=
htobe64
(
1
);
statusRpc
.
pCont
=
&
statusMsg
;
statusRpc
.
contLen
=
sizeof
(
SSchTasksStatusReq
);
statusRpc
.
msgType
=
TDMT_VND_TASKS_STATUS
;
stubSetStringToPlan
();
stubSetStringToPlan
();
stubSetRpcSendResponse
();
stubSetRpcSendResponse
();
...
@@ -814,35 +800,35 @@ TEST(seqTest, normalCase) {
...
@@ -814,35 +800,35 @@ TEST(seqTest, normalCase) {
code
=
qWorkerInit
(
NODE_TYPE_VNODE
,
1
,
NULL
,
&
mgmt
,
mockPointer
,
qwtPutReqToQueue
);
code
=
qWorkerInit
(
NODE_TYPE_VNODE
,
1
,
NULL
,
&
mgmt
,
mockPointer
,
qwtPutReqToQueue
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
code
=
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
code
=
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
code
=
qWorkerProcessReadyMsg
(
mockPointer
,
mgmt
,
&
readyRpc
);
code
=
qWorkerProcessReadyMsg
(
mockPointer
,
mgmt
,
&
readyRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
code
=
qWorkerProcessFetchMsg
(
mockPointer
,
mgmt
,
&
fetchRpc
);
code
=
qWorkerProcessFetchMsg
(
mockPointer
,
mgmt
,
&
fetchRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
code
=
qWorkerProcessDropMsg
(
mockPointer
,
mgmt
,
&
dropRpc
);
code
=
qWorkerProcessDropMsg
(
mockPointer
,
mgmt
,
&
dropRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
...
@@ -859,26 +845,9 @@ TEST(seqTest, cancelFirst) {
...
@@ -859,26 +845,9 @@ TEST(seqTest, cancelFirst) {
qwtInitLogFile
();
qwtInitLogFile
();
SSubQueryMsg
*
queryMsg
=
(
SSubQueryMsg
*
)
calloc
(
1
,
sizeof
(
SSubQueryMsg
)
+
100
);
qwtBuildQueryReqMsg
(
&
queryRpc
);
queryMsg
->
queryId
=
htobe64
(
1
);
qwtBuildDropReqMsg
(
&
qwtdropMsg
,
&
dropRpc
);
queryMsg
->
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
queryMsg
->
taskId
=
htobe64
(
1
);
queryMsg
->
contentLen
=
htonl
(
100
);
queryRpc
.
pCont
=
queryMsg
;
queryRpc
.
contLen
=
sizeof
(
SSubQueryMsg
)
+
100
;
STaskDropReq
dropMsg
=
{
0
};
dropMsg
.
sId
=
htobe64
(
1
);
dropMsg
.
queryId
=
htobe64
(
1
);
dropMsg
.
taskId
=
htobe64
(
1
);
dropRpc
.
pCont
=
&
dropMsg
;
dropRpc
.
contLen
=
sizeof
(
STaskDropReq
);
SSchTasksStatusReq
statusMsg
=
{
0
};
statusMsg
.
sId
=
htobe64
(
1
);
statusRpc
.
pCont
=
&
statusMsg
;
statusRpc
.
contLen
=
sizeof
(
SSchTasksStatusReq
);
statusRpc
.
msgType
=
TDMT_VND_TASKS_STATUS
;
stubSetStringToPlan
();
stubSetStringToPlan
();
stubSetRpcSendResponse
();
stubSetRpcSendResponse
();
...
@@ -886,21 +855,21 @@ TEST(seqTest, cancelFirst) {
...
@@ -886,21 +855,21 @@ TEST(seqTest, cancelFirst) {
code
=
qWorkerInit
(
NODE_TYPE_VNODE
,
1
,
NULL
,
&
mgmt
,
mockPointer
,
qwtPutReqToQueue
);
code
=
qWorkerInit
(
NODE_TYPE_VNODE
,
1
,
NULL
,
&
mgmt
,
mockPointer
,
qwtPutReqToQueue
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
code
=
qWorkerProcessDropMsg
(
mockPointer
,
mgmt
,
&
dropRpc
);
code
=
qWorkerProcessDropMsg
(
mockPointer
,
mgmt
,
&
dropRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
code
=
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
code
=
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
ASSERT_
EQ
(
code
,
TSDB_CODE_QRY_TASK_DROPPED
);
ASSERT_
TRUE
(
0
!=
code
);
statusMsg
.
sId
=
htobe64
(
1
);
qwtBuildStatusReqMsg
(
&
qwtstatusMsg
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
code
=
qWorkerProcessStatusMsg
(
mockPointer
,
mgmt
,
&
statusRpc
);
ASSERT_EQ
(
code
,
0
);
ASSERT_EQ
(
code
,
0
);
...
@@ -941,7 +910,6 @@ TEST(seqTest, randCase) {
...
@@ -941,7 +910,6 @@ TEST(seqTest, randCase) {
printf
(
"Query,%d
\n
"
,
t
++
);
printf
(
"Query,%d
\n
"
,
t
++
);
qwtBuildQueryReqMsg
(
&
queryRpc
);
qwtBuildQueryReqMsg
(
&
queryRpc
);
code
=
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
code
=
qWorkerProcessQueryMsg
(
mockPointer
,
mgmt
,
&
queryRpc
);
free
(
queryRpc
.
pCont
);
}
else
if
(
r
>=
maxr
/
5
&&
r
<
maxr
*
2
/
5
)
{
}
else
if
(
r
>=
maxr
/
5
&&
r
<
maxr
*
2
/
5
)
{
printf
(
"Ready,%d
\n
"
,
t
++
);
printf
(
"Ready,%d
\n
"
,
t
++
);
qwtBuildReadyReqMsg
(
&
readyMsg
,
&
readyRpc
);
qwtBuildReadyReqMsg
(
&
readyMsg
,
&
readyRpc
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录