From b0bf4cc4b728f40b744f3f9cdb38666521e1a73c Mon Sep 17 00:00:00 2001 From: Hao Jin Date: Thu, 2 Aug 2018 23:03:43 +0000 Subject: [PATCH] remove fixed seed for test_sparse_ndarray/test_operator_gpu.test_sparse_nd_pickle --- tests/python/unittest/test_sparse_ndarray.py | 22 +++++++++----------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/tests/python/unittest/test_sparse_ndarray.py b/tests/python/unittest/test_sparse_ndarray.py index 508f52301b42..7d3d58010b6e 100644 --- a/tests/python/unittest/test_sparse_ndarray.py +++ b/tests/python/unittest/test_sparse_ndarray.py @@ -514,24 +514,22 @@ def test_sparse_nd_astype_copy(): assert (id(x) == id(y)) -@with_seed(0) +@with_seed() def test_sparse_nd_pickle(): - repeat = 1 dim0 = 40 dim1 = 40 stypes = ['row_sparse', 'csr'] densities = [0, 0.5] stype_dict = {'row_sparse': RowSparseNDArray, 'csr': CSRNDArray} - for _ in range(repeat): - shape = rand_shape_2d(dim0, dim1) - for stype in stypes: - for density in densities: - a, _ = rand_sparse_ndarray(shape, stype, density) - assert isinstance(a, stype_dict[stype]) - data = pkl.dumps(a) - b = pkl.loads(data) - assert isinstance(b, stype_dict[stype]) - assert same(a.asnumpy(), b.asnumpy()) + shape = rand_shape_2d(dim0, dim1) + for stype in stypes: + for density in densities: + a, _ = rand_sparse_ndarray(shape, stype, density) + assert isinstance(a, stype_dict[stype]) + data = pkl.dumps(a) + b = pkl.loads(data) + assert isinstance(b, stype_dict[stype]) + assert same(a.asnumpy(), b.asnumpy()) # @kalyc: Getting rid of fixed seed as flakiness could not be reproduced