You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ja...@apache.org on 2019/04/18 10:32:47 UTC
[incubator-brpc] branch master updated: Make some timeout in UT
larger
This is an automated email from the ASF dual-hosted git repository.
jamesge pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git
The following commit(s) were added to refs/heads/master by this push:
new cde9a4a Make some timeout in UT larger
cde9a4a is described below
commit cde9a4a04a5e9d4960412214586b50914a2d68b1
Author: gejun <ge...@bilibili.com>
AuthorDate: Thu Apr 18 18:32:19 2019 +0800
Make some timeout in UT larger
---
test/brpc_channel_unittest.cpp | 8 ++++----
test/brpc_server_unittest.cpp | 8 ++++----
test/bthread_timer_thread_unittest.cpp | 2 +-
3 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/test/brpc_channel_unittest.cpp b/test/brpc_channel_unittest.cpp
index 049a497..cf7b1e2 100644
--- a/test/brpc_channel_unittest.cpp
+++ b/test/brpc_channel_unittest.cpp
@@ -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()), 10);
+ EXPECT_LT(labs(tm.m_elapsed() - cntl.timeout_ms()), 15);
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()), 10);
+ EXPECT_LT(labs(tm.m_elapsed() - cntl.timeout_ms()), 15);
StopAndJoin();
}
@@ -1255,7 +1255,7 @@ protected:
EXPECT_EQ(0, cntl.sub(i)->ErrorCode());
}
}
- EXPECT_LT(labs(tm.m_elapsed() - cntl.timeout_ms()), 10);
+ EXPECT_LT(labs(tm.m_elapsed() - cntl.timeout_ms()), 15);
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()), 10);
+ EXPECT_LT(labs(tm.m_elapsed() - cntl.timeout_ms()), 15);
StopAndJoin();
}
diff --git a/test/brpc_server_unittest.cpp b/test/brpc_server_unittest.cpp
index 575c88e..f000bf3 100644
--- a/test/brpc_server_unittest.cpp
+++ b/test/brpc_server_unittest.cpp
@@ -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) < 10) << timer.m_elapsed();
+ EXPECT_TRUE(labs(timer.m_elapsed() - 100) < 15) << 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() < 10) << timer.m_elapsed();
+ // EXPECT_TRUE(timer.m_elapsed() < 15) << 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) < 10) << timer.m_elapsed();
+ // EXPECT_TRUE(labs(timer.m_elapsed() - 50) < 15) << 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) < 10) << timer.m_elapsed();
+ EXPECT_TRUE(labs(timer.m_elapsed() - 100) < 15) << timer.m_elapsed();
bthread_join(tid, NULL);
}
}
diff --git a/test/bthread_timer_thread_unittest.cpp b/test/bthread_timer_thread_unittest.cpp
index 0276fb6..c44566b 100644
--- a/test/bthread_timer_thread_unittest.cpp
+++ b/test/bthread_timer_thread_unittest.cpp
@@ -131,7 +131,7 @@ TEST(TimerThreadTest, RunTasks) {
tm.start();
timer_thread.stop_and_join();
tm.stop();
- ASSERT_LE(tm.m_elapsed(), 10);
+ ASSERT_LE(tm.m_elapsed(), 15);
// verify all runs in expected time range.
keeper1.expect_first_run();
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org