From befb7bbd809e85d993206f4c3722b264e614267c Mon Sep 17 00:00:00 2001 From: Matthew Rocklin Date: Mon, 14 Nov 2016 07:47:06 -0500 Subject: [PATCH] Use SerializableLock in hdf5 test --- distributed/protocol/tests/test_h5py.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/distributed/protocol/tests/test_h5py.py b/distributed/protocol/tests/test_h5py.py index 648a2b9bbb5..f6088e1e878 100644 --- a/distributed/protocol/tests/test_h5py.py +++ b/distributed/protocol/tests/test_h5py.py @@ -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()