From ee5a0c96a0f189d809924659e98e33a98ea31297 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 4 May 2021 11:06:17 -0500 Subject: [PATCH] ceph_test_rados_api_service: stop threads before asserting Otherwise, if we assert, we'll hang here: Thread 1 (Thread 0x7f74eba79580 (LWP 1688617)): #0 0x00007f74eb2aa529 in futex_wait (private=, expected=132, futex_word=0x7ffd642b4b54) at ../sysdeps/unix/sysv/linux/futex-internal.h:61 #1 futex_wait_simple (private=, expected=132, futex_word=0x7ffd642b4b54) at ../sysdeps/nptl/futex-internal.h:135 #2 __pthread_cond_destroy (cond=0x7ffd642b4b30) at pthread_cond_destroy.c:54 #3 0x0000563ff2e5a891 in LibRadosService_StatusFormat_Test::TestBody (this=) at /usr/include/c++/7/bits/unique_ptr.h:78 #4 0x0000563ff2e9dc3a in testing::internal::HandleSehExceptionsInMethodIfSupported (location=0x563ff2ea72e4 "the test body", method=, object=0x563ff422a6d0) at ./src/googletest/googletest/src/gtest.cc:2605 #5 testing::internal::HandleExceptionsInMethodIfSupported (object=object@entry=0x563ff422a6d0, method=, location=location@entry=0x563ff2ea72e4 "the test body") at ./src/googletest/googletest/src/gtest.cc:2641 #6 0x0000563ff2e908c3 in testing::Test::Run (this=0x563ff422a6d0) at ./src/googletest/googletest/src/gtest.cc:2680 #7 0x0000563ff2e90a25 in testing::TestInfo::Run (this=0x563ff41a3b70) at ./src/googletest/googletest/src/gtest.cc:2858 #8 0x0000563ff2e90ec1 in testing::TestSuite::Run (this=0x563ff41b6230) at ./src/googletest/googletest/src/gtest.cc:3012 #9 0x0000563ff2e92bdc in testing::internal::UnitTestImpl::RunAllTests (this=) at ./src/googletest/googletest/src/gtest.cc:5723 #10 0x0000563ff2e9e14a in testing::internal::HandleSehExceptionsInMethodIfSupported (location=0x563ff2ea8728 "auxiliary test code (environments or event listeners)", method=, object=0x563ff41a2d10) at ./src/googletest/googletest/src/gtest.cc:2605 #11 testing::internal::HandleExceptionsInMethodIfSupported (object=0x563ff41a2d10, method=, location=location@entry=0x563ff2ea8728 "auxiliary test code (environments or event listeners)") at ./src/googletest/googletest/src/gtest.cc:2641 #12 0x0000563ff2e90ae8 in testing::UnitTest::Run (this=0x563ff30c0660 ) at ./src/googletest/googletest/src/gtest.cc:5306 Signed-off-by: Sage Weil --- src/test/librados/service.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/librados/service.cc b/src/test/librados/service.cc index b9fccf96b98..4db34a2925d 100644 --- a/src/test/librados/service.cc +++ b/src/test/librados/service.cc @@ -163,7 +163,6 @@ TEST(LibRadosService, StatusFormat) { sleep(2); retry--; } - ASSERT_NE(0, retry); { std::scoped_lock l(lock); @@ -173,6 +172,7 @@ TEST(LibRadosService, StatusFormat) { for (int i = 0; i < nthreads; ++i) threads[i].join(); + ASSERT_NE(0, retry); ASSERT_EQ(setrlimit(RLIMIT_NOFILE, &rold), 0); } -- 2.39.5