]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: TestJournalReplay test cases need to wait for committed journal event 11480/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 13 Oct 2016 14:04:24 +0000 (10:04 -0400)
committerJason Dillaman <dillaman@redhat.com>
Thu, 13 Oct 2016 14:04:24 +0000 (10:04 -0400)
Fixes: http://tracker.ceph.com/issues/17566
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/test/librbd/journal/test_Replay.cc

index 4622c2789d006ed42e26fdb3f9e6803314ae00c7..9abfb5e54de2eae62ca4a58b18a4341a08d48b5e 100644 (file)
@@ -42,14 +42,16 @@ public:
 
   template<typename T>
   void inject_into_journal(librbd::ImageCtx *ictx, T event) {
-
+    C_SaferCond ctx;
     librbd::journal::EventEntry event_entry(event);
     librbd::Journal<>::AioObjectRequests requests;
     {
       RWLock::RLocker owner_locker(ictx->owner_lock);
-      ictx->journal->append_io_event(std::move(event_entry), requests, 0, 0,
-                                     true);
+      uint64_t tid = ictx->journal->append_io_event(std::move(event_entry),
+                                                    requests, 0, 0, true);
+      ictx->journal->wait_event(tid, &ctx);
     }
+    ASSERT_EQ(0, ctx.wait());
   }
 
   void get_journal_commit_position(librbd::ImageCtx *ictx, int64_t *tag,