Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
cde9a4a0
Commit
cde9a4a0
authored
Apr 18, 2019
by
gejun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make some timeout in UT larger
parent
acce7799
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
brpc_channel_unittest.cpp
test/brpc_channel_unittest.cpp
+4
-4
brpc_server_unittest.cpp
test/brpc_server_unittest.cpp
+4
-4
bthread_timer_thread_unittest.cpp
test/bthread_timer_thread_unittest.cpp
+1
-1
No files found.
test/brpc_channel_unittest.cpp
View file @
cde9a4a0
...
...
@@ -1166,7 +1166,7 @@ protected:
CallMethod
(
&
channel
,
&
cntl
,
&
req
,
&
res
,
async
);
tm
.
stop
();
EXPECT_EQ
(
brpc
::
ERPCTIMEDOUT
,
cntl
.
ErrorCode
())
<<
cntl
.
ErrorText
();
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
0
);
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
5
);
StopAndJoin
();
}
...
...
@@ -1202,7 +1202,7 @@ protected:
for
(
int
i
=
0
;
i
<
cntl
.
sub_count
();
++
i
)
{
EXPECT_EQ
(
ECANCELED
,
cntl
.
sub
(
i
)
->
ErrorCode
())
<<
"i="
<<
i
;
}
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
0
);
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
5
);
StopAndJoin
();
}
...
...
@@ -1255,7 +1255,7 @@ protected:
EXPECT_EQ
(
0
,
cntl
.
sub
(
i
)
->
ErrorCode
());
}
}
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
0
);
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
5
);
StopAndJoin
();
}
...
...
@@ -1288,7 +1288,7 @@ protected:
EXPECT_EQ
(
brpc
::
ERPCTIMEDOUT
,
cntl
.
ErrorCode
())
<<
cntl
.
ErrorText
();
EXPECT_EQ
(
1
,
cntl
.
sub_count
());
EXPECT_EQ
(
brpc
::
ERPCTIMEDOUT
,
cntl
.
sub
(
0
)
->
ErrorCode
());
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
0
);
EXPECT_LT
(
labs
(
tm
.
m_elapsed
()
-
cntl
.
timeout_ms
()),
1
5
);
StopAndJoin
();
}
...
...
test/brpc_server_unittest.cpp
View file @
cde9a4a0
...
...
@@ -1043,7 +1043,7 @@ TEST_F(ServerTest, logoff_and_multiple_start) {
ASSERT_EQ
(
0
,
server
.
Stop
(
-
1
));
ASSERT_EQ
(
0
,
server
.
Join
());
timer
.
stop
();
EXPECT_TRUE
(
labs
(
timer
.
m_elapsed
()
-
100
)
<
1
0
)
<<
timer
.
m_elapsed
();
EXPECT_TRUE
(
labs
(
timer
.
m_elapsed
()
-
100
)
<
1
5
)
<<
timer
.
m_elapsed
();
bthread_join
(
tid
,
NULL
);
}
...
...
@@ -1066,7 +1066,7 @@ TEST_F(ServerTest, logoff_and_multiple_start) {
timer
.
stop
();
// Assertion will fail since EchoServiceImpl::Echo is holding
// additional reference to the `Socket'
// EXPECT_TRUE(timer.m_elapsed() < 1
0
) << timer.m_elapsed();
// EXPECT_TRUE(timer.m_elapsed() < 1
5
) << timer.m_elapsed();
bthread_join
(
tid
,
NULL
);
}
...
...
@@ -1089,7 +1089,7 @@ TEST_F(ServerTest, logoff_and_multiple_start) {
timer
.
stop
();
// Assertion will fail since EchoServiceImpl::Echo is holding
// additional reference to the `Socket'
// EXPECT_TRUE(labs(timer.m_elapsed() - 50) < 1
0
) << timer.m_elapsed();
// EXPECT_TRUE(labs(timer.m_elapsed() - 50) < 1
5
) << timer.m_elapsed();
bthread_join
(
tid
,
NULL
);
}
...
...
@@ -1109,7 +1109,7 @@ TEST_F(ServerTest, logoff_and_multiple_start) {
ASSERT_EQ
(
0
,
server
.
Stop
(
1000
));
ASSERT_EQ
(
0
,
server
.
Join
());
timer
.
stop
();
EXPECT_TRUE
(
labs
(
timer
.
m_elapsed
()
-
100
)
<
1
0
)
<<
timer
.
m_elapsed
();
EXPECT_TRUE
(
labs
(
timer
.
m_elapsed
()
-
100
)
<
1
5
)
<<
timer
.
m_elapsed
();
bthread_join
(
tid
,
NULL
);
}
}
...
...
test/bthread_timer_thread_unittest.cpp
View file @
cde9a4a0
...
...
@@ -131,7 +131,7 @@ TEST(TimerThreadTest, RunTasks) {
tm
.
start
();
timer_thread
.
stop_and_join
();
tm
.
stop
();
ASSERT_LE
(
tm
.
m_elapsed
(),
1
0
);
ASSERT_LE
(
tm
.
m_elapsed
(),
1
5
);
// verify all runs in expected time range.
keeper1
.
expect_first_run
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment