@@ -69,7 +69,7 @@ def _set_arange(arg):
69
69
class MixinArraySyncTests (object ):
70
70
71
71
def test_parallel_setitem (self ):
72
- n = 20
72
+ n = 100
73
73
74
74
# setup
75
75
arr = self .create_array (shape = n * 1000 , chunks = 999 , dtype = 'i4' )
@@ -78,13 +78,16 @@ def test_parallel_setitem(self):
78
78
79
79
# parallel setitem
80
80
future = pool .map_async (_set_arange , zip ([arr ] * n , range (n )))
81
+ pool .close ()
81
82
results = sorted (future .get (60 ))
83
+ pool .terminate ()
84
+
82
85
print (results )
83
86
eq (list (range (n )), results )
84
87
assert_array_equal (np .arange (n * 1000 ), arr [:])
85
88
86
89
def test_parallel_append (self ):
87
- n = 20
90
+ n = 100
88
91
89
92
# setup
90
93
arr = self .create_array (shape = 1000 , chunks = 999 , dtype = 'i4' )
@@ -93,7 +96,10 @@ def test_parallel_append(self):
93
96
94
97
# parallel append
95
98
future = pool .map_async (_append , zip ([arr ] * n , range (n )))
99
+ pool .close ()
96
100
results = sorted (future .get (60 ))
101
+ pool .terminate ()
102
+
97
103
print (results )
98
104
eq ([((i + 2 )* 1000 ,) for i in range (n )], results )
99
105
eq (((n + 1 )* 1000 ,), arr .shape )
@@ -181,10 +187,13 @@ def test_parallel_create_group(self):
181
187
182
188
# parallel create group
183
189
n = 100
184
- results = pool .map_async (
190
+ future = pool .map_async (
185
191
_create_group , zip ([g ] * n , [str (i ) for i in range (n )]))
186
- print (results .get (60 ))
192
+ pool .close ()
193
+ results = sorted (future .get (60 ))
194
+ pool .terminate ()
187
195
196
+ print (results )
188
197
eq (n , len (g ))
189
198
190
199
def test_parallel_require_group (self ):
@@ -195,10 +204,13 @@ def test_parallel_require_group(self):
195
204
196
205
# parallel require group
197
206
n = 100
198
- results = pool .map_async (
207
+ future = pool .map_async (
199
208
_require_group , zip ([g ] * n , [str (i // 10 ) for i in range (n )]))
200
- print (results .get (60 ))
209
+ pool .close ()
210
+ results = sorted (future .get (60 ))
211
+ pool .terminate ()
201
212
213
+ print (results )
202
214
eq (n // 10 , len (g ))
203
215
204
216
0 commit comments