From 4f9e02c40ac5359f344d29f20332ec6ed8575b8e Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 13 Oct 2016 10:04:24 -0400 Subject: [PATCH] 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) --- src/test/librbd/journal/test_Replay.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/librbd/journal/test_Replay.cc b/src/test/librbd/journal/test_Replay.cc index e5ff7490ab5b6..4710d01528a40 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, -- 2.39.5