Merge pull request #11480 from dillaman/wip-17566

test: TestJournalReplay test cases need to wait for event commit

Reviewed-by: Venky Shankar <vshankar@redhat.com>
This commit is contained in:
Kefu Chai 2016-10-20 17:13:15 +08:00 committed by GitHub
commit ebe88ca8a8

View 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,