Skip to content

Commit

Permalink
test_rados_watch_notify: add async_watch_flush tests
Browse files Browse the repository at this point in the history
Signed-off-by: Haomai Wang <haomai@xsky.com>
  • Loading branch information
yuyuyu101 committed Feb 19, 2016
1 parent 414d440 commit 5ec9015
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/test/librados/watch_notify.cc
Expand Up @@ -726,7 +726,14 @@ TEST_F(LibRadosWatchNotify, WatchNotify2Timeout) {
ASSERT_GT(rados_watch_check(ioctx, handle), 0);

rados_unwatch2(ioctx, handle);
rados_watch_flush(cluster);

rados_completion_t comp;
ASSERT_EQ(0, rados_aio_create_completion(NULL, NULL, NULL, &comp));
rados_async_watch_flush(cluster, comp);
ASSERT_EQ(0, rados_aio_wait_for_complete(comp));
ASSERT_EQ(0, rados_aio_get_return_value(comp));
rados_aio_release(comp);

}

TEST_P(LibRadosWatchNotifyPP, WatchNotify2Timeout) {
Expand Down Expand Up @@ -754,9 +761,14 @@ TEST_P(LibRadosWatchNotifyPP, WatchNotify2Timeout) {
std::cout << " timed out" << std::endl;
ASSERT_GT(ioctx.watch_check(handle), 0);
ioctx.unwatch2(handle);

std::cout << " flushing" << std::endl;
cluster.watch_flush();
librados::AioCompletion *comp = cluster.aio_create_completion();
cluster.async_watch_flush(comp);
ASSERT_EQ(0, comp->wait_for_complete());
ASSERT_EQ(0, comp->get_return_value());
std::cout << " flushed" << std::endl;
comp->release();
}

// --
Expand Down

0 comments on commit 5ec9015

Please sign in to comment.