]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: TestJournalReplay test cases need to wait for committed journal event 11590/head
authorJason Dillaman <dillaman@redhat.com>
Thu, 13 Oct 2016 14:04:24 +0000 (10:04 -0400)
committerLoic Dachary <ldachary@redhat.com>
Fri, 21 Oct 2016 12:37:17 +0000 (14:37 +0200)
Fixes: http://tracker.ceph.com/issues/17566
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
(cherry picked from commit 1bdf7a425eb7436838c9445ea2c8ab42dfd3a1b6)

src/test/librbd/journal/test_Replay.cc

index e5ff7490ab5b6e10bf7e1ad943f7c519dd8302bc..4710d01528a40bfb22244af73758285649d48641 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,