]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/amqp: skip idleness tests since it needs to sleep longer than 30s 53506/head
authorYuval Lifshitz <ylifshit@redhat.com>
Wed, 2 Aug 2023 10:19:00 +0000 (10:19 +0000)
committerYuval Lifshitz <ylifshit@redhat.com>
Tue, 26 Sep 2023 09:01:00 +0000 (09:01 +0000)
current idle timeout is 30s, so, making the test sleep for 30s may not
be enough. setting sleep time to be longer, and skippign the test so it
won't take too long.

Fixes: https://tracker.ceph.com/issues/62264
Signed-off-by: Yuval Lifshitz <ylifshit@redhat.com>
(cherry picked from commit 11439ecd8957cdf90b80fd52cc500372ffd24685)

src/test/rgw/test_rgw_amqp.cc

index bf8671771d9eb72e4dc8739059236e9929080747..b9ee81faf1c51d36884db50f284ac32ca80eff9c 100644 (file)
@@ -13,6 +13,7 @@ using namespace rgw;
 
 const std::chrono::milliseconds wait_time(10);
 const std::chrono::milliseconds long_wait_time = wait_time*50;
+const std::chrono::seconds idle_time(35);
 
 
 class CctCleaner {
@@ -457,3 +458,17 @@ TEST_F(TestAMQP, RetryFailWrite)
   amqp_mock::set_valid_host("localhost");
 }
 
+TEST_F(TestAMQP, IdleConnection)
+{
+  // this test is skipped since it takes 30seconds
+  GTEST_SKIP();
+  const auto connection_number = amqp::get_connection_count();
+  auto conn = amqp::connect("amqp://localhost", "ex1", false, false, boost::none);
+  EXPECT_EQ(amqp::get_connection_count(), connection_number + 1);
+  std::this_thread::sleep_for(idle_time);
+  EXPECT_EQ(amqp::get_connection_count(), connection_number);
+  auto rc = amqp::publish_with_confirm(conn, "topic", "message", my_callback_expect_nack);
+  EXPECT_EQ(rc, 0);
+  wait_until_drained();
+}
+