]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/amqp: remove a test that requires syncronization 31628/head
authorYuval Lifshitz <yuvalif@yahoo.com>
Sun, 10 Nov 2019 09:57:57 +0000 (11:57 +0200)
committerYuval Lifshitz <yuvalif@yahoo.com>
Thu, 14 Nov 2019 08:44:42 +0000 (10:44 +0200)
betwen the amqp manager internal thread and the test itself
amqp reconnect should be tested by system test instead

Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
(cherry picked from commit 10a27ef809c4e3f745f2726a5f0be8d8579a5979)
Signed-off-by: Yuval Lifshitz <yuvalif@yahoo.com>
src/test/rgw/test_rgw_amqp.cc

index 92b0d497849fb02a1d946212f17f419195ffa2a9..0f11b817e8d19e97b0c844c183e98f423a5d1aa2 100644 (file)
@@ -454,57 +454,3 @@ TEST_F(TestAMQP, RetryFailWrite)
   amqp_mock::set_valid_host("localhost");
 }
 
-int fail_after = -1;
-int recover_after = -1;
-bool expect_zero_rc = true;
-
-void my_callback_triggering_failure(int rc) {
-  if (expect_zero_rc) {
-      EXPECT_EQ(rc, 0);
-  } else {
-      EXPECT_NE(rc, 0);
-  }
-  ++callbacks_invoked;
-  if (fail_after == callbacks_invoked) {
-    amqp_mock::FAIL_NEXT_READ = true;
-    expect_zero_rc = false;
-
-  }
-  if (recover_after == callbacks_invoked) {
-    amqp_mock::FAIL_NEXT_READ = false;
-  }
-}
-
-TEST_F(TestAMQP, AcksWithReconnect)
-{
-  callbacks_invoked = 0;
-  const std::string host("localhost1");
-  amqp_mock::set_valid_host(host);
-  conn = amqp::connect("amqp://" + host, "ex1");
-  EXPECT_TRUE(conn);
-  amqp_mock::set_multiple(59);
-  // failure will take effect after: max(59, 70)
-  fail_after = 70;
-  // all callback are flushed during failure, so, recover will take effect after: max(90, 100)
-  recover_after = 90;
-  const auto NUMBER_OF_CALLS = 100;
-  for (auto i = 0; i < NUMBER_OF_CALLS; ++i) {
-    auto rc = publish_with_confirm(conn, "topic", "message", my_callback_triggering_failure);
-    EXPECT_EQ(rc, 0);
-  }
-  // connection failes before multiple acks
-  wait_until_drained();
-  EXPECT_EQ(callbacks_invoked, NUMBER_OF_CALLS);
-  // publish more mesages
-  expect_zero_rc = true;
-  for (auto i = 0; i < NUMBER_OF_CALLS; ++i) {
-    auto rc = publish_with_confirm(conn, "topic", "message", my_callback_triggering_failure);
-    EXPECT_EQ(rc, 0);
-  }
-  wait_until_drained();
-  EXPECT_EQ(callbacks_invoked, 2*NUMBER_OF_CALLS);
-  callbacks_invoked = 0;
-  amqp_mock::set_valid_host("localhost");
-  fail_after = -1;
-}
-