Merge pull request #31158 from zjcmszh/test_remove

test/pybind/test_rados.py: test test_operate_aio_write_op()

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2019-11-17 00:53:30 +08:00 committed by GitHub
commit aa62a162a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -596,6 +596,24 @@ class TestIoctx(object):
eq(objects, [])
self.ioctx.set_locator_key("")
def test_operate_aio_write_op(self):
lock = threading.Condition()
count = [0]
def cb(blah):
with lock:
count[0] += 1
lock.notify()
return 0
with WriteOpCtx() as write_op:
write_op.write(b'rzx')
comp = self.ioctx.operate_aio_write_op(write_op, "object", cb, cb)
comp.wait_for_complete()
with lock:
while count[0] < 2:
lock.wait()
eq(comp.get_return_value(), 0)
eq(self.ioctx.read('object'), b'rzx')
def test_aio_write(self):
lock = threading.Condition()
count = [0]