Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions distributed/protocol/tests/test_h5py.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,16 @@ def test_raise_error_on_serialize_write_permissions():

@gen_cluster(client=True)
def test_h5py_serialize(c, s, a, b):
from dask.utils import SerializableLock
lock = SerializableLock('hdf5')
with tmpfile() as fn:
with h5py.File(fn, mode='a') as f:
x = f.create_dataset('/group/x', shape=(4,), dtype='i4',
chunks=(2,))
x[:] = [1, 2, 3, 4]
f.flush()
with h5py.File(fn, mode='r') as f:
dset = f['/group/x']
x = da.from_array(dset, chunks=dset.chunks)
x = da.from_array(dset, chunks=dset.chunks, lock=lock)
y = c.compute(x)
y = yield y._result()
assert (y[:] == dset[:]).all()