From: Jason Dillaman Date: Thu, 13 Oct 2016 14:04:24 +0000 (-0400) Subject: test: TestJournalReplay test cases need to wait for committed journal event X-Git-Tag: v10.2.4~24^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F11590%2Fhead;p=ceph.git test: TestJournalReplay test cases need to wait for committed journal event Fixes: http://tracker.ceph.com/issues/17566 Signed-off-by: Jason Dillaman (cherry picked from commit 1bdf7a425eb7436838c9445ea2c8ab42dfd3a1b6) --- diff --git a/src/test/librbd/journal/test_Replay.cc b/src/test/librbd/journal/test_Replay.cc index e5ff7490ab5b..4710d01528a4 100644 --- a/src/test/librbd/journal/test_Replay.cc +++ b/src/test/librbd/journal/test_Replay.cc @@ -42,14 +42,16 @@ public: template 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,