]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: correct two issues with the librados_test_stub
authorJason Dillaman <dillaman@redhat.com>
Tue, 27 Jan 2015 22:29:03 +0000 (17:29 -0500)
committerJason Dillaman <dillaman@redhat.com>
Thu, 29 Jan 2015 02:12:53 +0000 (21:12 -0500)
Corrected a problem where the snapshot id was being incorrectly
replaced on history object versions.  Also corrected an issue
with handling flushing the AIO worker threads.

Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librados_test_stub/TestMemIoCtxImpl.cc
src/test/librados_test_stub/TestRadosClient.cc

index 0c3eac6fa11c01da84bc8a9468288f2a4d82afce..05103b0c299dd1900541417b047fac75fabd4f93 100644 (file)
@@ -555,7 +555,6 @@ TestMemRadosClient::SharedFile TestMemIoCtxImpl::get_file(
             file->snaps.push_back(*seq_it);
           }
         }
-        file->snap_id = file->snaps.back();
 
         uint64_t prev_size = file->data.length();
         file = TestMemRadosClient::SharedFile(
index 91734f21a11b25fd156296a50cd5e12709aa29af..7db26bc89dba9397eafea69114cc2d86d0588ad6 100644 (file)
@@ -191,10 +191,18 @@ void TestRadosClient::flush_aio_operations() {
 }
 
 void TestRadosClient::flush_aio_operations(AioCompletionImpl *c) {
+  c->get();
+
   WaitForFlush *wait_for_flush = new WaitForFlush();
   wait_for_flush->count.set(m_finishers.size());
   wait_for_flush->c = c;
-  add_aio_operation("", boost::bind(&WaitForFlush::flushed, wait_for_flush), NULL);
+
+  for (size_t i = 0; i < m_finishers.size(); ++i) {
+    AioFunctionContext *ctx = new AioFunctionContext(
+      boost::bind(&WaitForFlush::flushed, wait_for_flush),
+      NULL);
+    m_finishers[i]->queue(ctx);
+  }
 }
 
 Finisher *TestRadosClient::get_finisher(const std::string &oid) {