This is an automated email from the ASF dual-hosted git repository.
chenBright pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new b4732eb8 Stabilize butex stop-after-running test (#3562)
b4732eb8 is described below
commit b4732eb846196a9b9b44bb377ce0dba64ab12ffe
Author: Xiaofeng Wang <[email protected]>
AuthorDate: Wed Sep 23 10:26:55 2026 +0800
Stabilize butex stop-after-running test (#3562)
---
test/bthread_butex_unittest.cpp | 4 ----
1 file changed, 4 deletions(-)
diff --git a/test/bthread_butex_unittest.cpp b/test/bthread_butex_unittest.cpp
index a92f447d..924f30cb 100644
--- a/test/bthread_butex_unittest.cpp
+++ b/test/bthread_butex_unittest.cpp
@@ -241,7 +241,6 @@ TEST(ButexTest, wait_without_stop) {
TEST(ButexTest, stop_after_running) {
int* butex = bthread::butex_create_checked<int>();
*butex = 7;
- butil::Timer tm;
const long WAIT_MSEC = 500;
const long SLEEP_MSEC = 10;
for (int i = 0; i < 2; ++i) {
@@ -250,14 +249,11 @@ TEST(ButexTest, stop_after_running) {
bthread_t th;
ButexWaitArg arg = { butex, *butex, WAIT_MSEC, EINTR };
- tm.start();
ASSERT_EQ(0, bthread_start_urgent(&th, &attr, wait_butex, &arg));
ASSERT_EQ(0, bthread_usleep(SLEEP_MSEC * 1000L));
ASSERT_EQ(0, bthread_stop(th));
ASSERT_EQ(0, bthread_join(th, nullptr));
- tm.stop();
- ASSERT_LT(labs(tm.m_elapsed() - SLEEP_MSEC), 25);
// ASSERT_TRUE(bthread::get_task_control()->
// timer_thread()._idset.empty());
ASSERT_EQ(EINVAL, bthread_stop(th));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]