Skip to content

Commit

Permalink
tweak params of some UT
Browse files Browse the repository at this point in the history
  • Loading branch information
gejun committed Sep 19, 2017
1 parent 2a1d50d commit ce673b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions test/brpc_builtin_service_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,8 +648,8 @@ TEST_F(BuiltinServiceTest, pprof) {
ClosureChecker done;
brpc::Controller cntl;
service.heap(&cntl, NULL, NULL, &done);
// MUST fail since tcmalloc hasn't been linked in
EXPECT_EQ(brpc::ENOMETHOD, cntl.ErrorCode());
const int rc = getenv("TCMALLOC_SAMPLE_PARAMETER") ? 0 : brpc::ENOMETHOD;
EXPECT_EQ(rc, cntl.ErrorCode());
}
{
ClosureChecker done;
Expand Down
2 changes: 1 addition & 1 deletion test/bthread_cond_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ TEST(CondTest, sanity) {
long delta = wake_time[i] - last_time - SIGNAL_INTERVAL_US;
EXPECT_GT(wake_time[i], last_time);
square_sum += delta * delta;
EXPECT_LT(abs(delta), 1000L) << "error[" << i << "]=" << delta << "="
EXPECT_LT(abs(delta), 2000L) << "error[" << i << "]=" << delta << "="
<< wake_time[i] << " - " << last_time;
}
printf("Average error is %fus\n", sqrt(square_sum / std::max(nbeforestop, 1UL)));
Expand Down
4 changes: 2 additions & 2 deletions test/bvar_reducer_unittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ TEST_F(ReducerTest, adder) {
ASSERT_EQ(-5, reducer3.get_value());
}

const size_t OPS_PER_THREAD = 5000000;
const size_t OPS_PER_THREAD = 500000;

static void *thread_counter(void *arg) {
bvar::Adder<uint64_t> *reducer = (bvar::Adder<uint64_t> *)arg;
Expand Down Expand Up @@ -297,7 +297,7 @@ TEST_F(ReducerTest, non_primitive_mt) {
for (size_t i = 0; i < arraysize(th); ++i) {
pthread_create(&th[i], NULL, string_appender, &cater);
}
usleep(10000);
usleep(50000);
g_stop = true;
butil::hash_map<pthread_t, int> appended_count;
for (size_t i = 0; i < arraysize(th); ++i) {
Expand Down

0 comments on commit ce673b5

Please sign in to comment.