diff --git a/tile/base/thread/cond_var_test.cc b/tile/base/thread/cond_var_test.cc index 31067d3..9009c5c 100644 --- a/tile/base/thread/cond_var_test.cc +++ b/tile/base/thread/cond_var_test.cc @@ -85,7 +85,6 @@ TEST_F(CondVarTest, NotifyOne_Wait) { TEST_F(CondVarTest, NotifyOne_WaitFor) { // Wait // constexpr auto kWaitTimeoutMs = 100; - auto start = ReadSteadyClock(); constexpr auto kWaitTimeout = std::chrono::milliseconds(50); auto WaitFor = [&] { UniqueLock inner_locker(*m); @@ -110,16 +109,9 @@ TEST_F(CondVarTest, NotifyOne_WaitFor) { cv->NotifyOne(); } - auto now = ReadSteadyClock(); worker->join(); - if (now - start > kWaitTimeout) { - // timeout - ASSERT_TRUE(is_timeout); - ASSERT_FALSE(is_set); - } else { - ASSERT_FALSE(is_timeout); - ASSERT_TRUE(is_set); - } + ASSERT_FALSE(is_timeout); + ASSERT_TRUE(is_set); } // timeout diff --git a/tile/base/thread/scoped_lock_test.cc b/tile/base/thread/scoped_lock_test.cc index 6d661f4..cef6f79 100644 --- a/tile/base/thread/scoped_lock_test.cc +++ b/tile/base/thread/scoped_lock_test.cc @@ -249,8 +249,8 @@ TEST(ScopedLock, TryLock) { } TEST(ScopedLock, MultiThread) { - constexpr std::size_t kThreadCount = 5; - constexpr std::size_t kLoopCount = 10000; + constexpr std::size_t kThreadCount = 4; + constexpr std::size_t kLoopCount = 1000; int x = 0; Mutex m;