]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librados/aio_cxx: Fix Pool EIO flag tests 49278/head
authorMatan Breizman <mbreizma@redhat.com>
Tue, 6 Dec 2022 09:36:43 +0000 (09:36 +0000)
committerMatan Breizman <mbreizma@redhat.com>
Tue, 6 Dec 2022 09:43:07 +0000 (09:43 +0000)
* When tested with multiple OSDs SimplePoolEIO test
  will fail (error reply messages order) - test is removed.

* Timeout edited to avoid infinite test.

Fixes: https://tracker.ceph.com/issues/58173
Signed-off-by: Matan Breizman <mbreizma@redhat.com>
src/test/librados/aio_cxx.cc

index fb657ff18ec96c1bb84ddfd5c5eb442acb909f69..6f6e79b203f8f9277049e6efac2bedf6578dda82 100644 (file)
@@ -2288,35 +2288,6 @@ void pool_io_callback(completion_t cb, void *arg /* Actually AioCompletion* */)
   }
 }
 
-TEST(LibRadosAio, SimplePoolEIOFlag) {
-  AioTestDataPP test_data;
-  ASSERT_EQ("", test_data.init());
-
-    auto my_completion = std::unique_ptr<AioCompletion>{Rados::aio_create_completion()};
-    ASSERT_TRUE(my_completion);
-
-    bufferlist empty;
-    ASSERT_EQ(0, test_data.m_cluster.mon_command(
-      fmt::format(R"({{
-                  "prefix": "osd pool set",
-                  "pool": "{}",
-                  "var": "eio",
-                  "val": "true"
-                  }})", test_data.m_pool_name),
-      empty, nullptr, nullptr));
-
-    bufferlist bl;
-    bl.append("some data");
-
-    ASSERT_EQ(0, test_data.m_ioctx.aio_write("foo", my_completion.get(),
-                                             bl, bl.length(), 0));
-    {
-      TestAlarm alarm;
-      ASSERT_EQ(0, my_completion->wait_for_complete());
-    }
-    ASSERT_EQ(-EIO, my_completion->get_return_value());
-}
-
 TEST(LibRadosAio, PoolEIOFlag) {
   AioTestDataPP test_data;
   ASSERT_EQ("", test_data.init());
@@ -2326,9 +2297,10 @@ TEST(LibRadosAio, PoolEIOFlag) {
   std::thread *t = nullptr;
   
   unsigned max = 100;
+  unsigned timeout = max * 10;
   unsigned long i = 1;
   my_lock.lock();
-  for (; min_failed == 0 && i <= max; ++i) {
+  for (; min_failed == 0 && i <= timeout; ++i) {
     io_info *info = new io_info;
     info->i = i;
     info->c = Rados::aio_create_completion();
@@ -2366,7 +2338,7 @@ TEST(LibRadosAio, PoolEIOFlag) {
 
   // wait for ios to finish
   for (; !inflight.empty(); ++i) {
-    cout << "waiting for " << inflight << std::endl;
+    cout << "waiting for " << inflight.size() << std::endl;
     my_lock.unlock();
     sleep(1);
     my_lock.lock();