Commit cde9a4a0 authored by gejun's avatar gejun

Make some timeout in UT larger

parent acce7799
......@@ -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();
}
......
......@@ -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);
}
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment