]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/test: do not test exception raised from recursive lock
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 30 Sep 2024 13:53:09 +0000 (09:53 -0400)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 2 Oct 2024 14:44:53 +0000 (10:44 -0400)
The C++ standard does not require that implementations raise std::system_error
when double-locking a non-recursive lock. Our implementation of debug_mutex
now catches this error with a ceph_assert so it cannot be caught.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/test/common/test_mutex_debug.cc

index 565dcd64de9c075692b1e72c5f76fa834fa5540d..29eb8076859c90bd32fd90a2cc8d1ece822e81f1 100644 (file)
@@ -65,7 +65,6 @@ TEST(MutexDebug, NotRecursive) {
   ASSERT_TRUE(m.is_locked());
   ASSERT_FALSE(std::async(std::launch::async, ttl, &m).get());
 
-  ASSERT_THROW(m.lock(), std::system_error);
   ASSERT_TRUE(m.is_locked());
   ASSERT_FALSE(std::async(std::launch::async, ttl, &m).get());