summaryrefslogtreecommitdiff
path: root/numpy/fft/tests
diff options
context:
space:
mode:
authorJulian Taylor <jtaylor.debian@googlemail.com>2014-05-16 00:34:46 +0200
committerJulian Taylor <jtaylor.debian@googlemail.com>2014-05-16 00:38:22 +0200
commitedb67b65cfc2143381fbcfae6569772cf37c2e3d (patch)
tree61f8bb9bb8b97b2bcb7cfe472d8148fe64d01c14 /numpy/fft/tests
parent003fcdad5bc6c062506853a8a0df89ea0ceb3916 (diff)
downloadnumpy-edb67b65cfc2143381fbcfae6569772cf37c2e3d.tar.gz
TST: reduce memory usage of fft test
tests should not use more than 500 MB of memory, this one uses more than a GB. Also it didn't join its threads.
Diffstat (limited to 'numpy/fft/tests')
-rw-r--r--numpy/fft/tests/test_fftpack.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/numpy/fft/tests/test_fftpack.py b/numpy/fft/tests/test_fftpack.py
index ba19e5594..ac892c83b 100644
--- a/numpy/fft/tests/test_fftpack.py
+++ b/numpy/fft/tests/test_fftpack.py
@@ -34,7 +34,7 @@ class TestFFT1D(TestCase):
class TestFFTThreadSafe(TestCase):
threads = 16
- input_shape = (1000, 1000)
+ input_shape = (800, 200)
def _test_mtsame(self, func, *args):
def worker(args, q):
@@ -44,13 +44,15 @@ class TestFFTThreadSafe(TestCase):
expected = func(*args)
# Spin off a bunch of threads to call the same function simultaneously
- for i in range(self.threads):
- threading.Thread(target=worker, args=(args, q)).start()
+ t = [threading.Thread(target=worker, args=(args, q))
+ for i in range(self.threads)]
+ [x.start() for x in t]
# Make sure all threads returned the correct value
for i in range(self.threads):
assert_array_equal(q.get(timeout=5), expected,
'Function returned wrong value in multithreaded context')
+ [x.join() for x in t]
def test_fft(self):
a = np.ones(self.input_shape) * 1+0j