summaryrefslogtreecommitdiff
path: root/tests/test_concurrency.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2015-02-22 21:55:45 -0500
committerNed Batchelder <ned@nedbatchelder.com>2015-02-22 21:55:45 -0500
commit7fd0385cfa5b776b4c7b10c4ff077296db005c49 (patch)
tree37567b269a2491eed276dc725234fade3d2bb0f2 /tests/test_concurrency.py
parent1b04c715aa30a2e2a4cf3f6c3d0b65b93363c83d (diff)
parentae8870bf5732895c1e68c6f64268a775a617f403 (diff)
downloadpython-coveragepy-7fd0385cfa5b776b4c7b10c4ff077296db005c49.tar.gz
Merge other work
Diffstat (limited to 'tests/test_concurrency.py')
-rw-r--r--tests/test_concurrency.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py
index 9a82a0c..93809df 100644
--- a/tests/test_concurrency.py
+++ b/tests/test_concurrency.py
@@ -239,7 +239,7 @@ class MultiprocessingTest(CoverageTest):
def func(x):
# Need to pause, or the tasks go too quick, and some processes
# in the pool don't get any work, and then don't record data.
- time.sleep(0.01)
+ time.sleep(0.02)
# Use different lines in different subprocesses.
if x % 2:
y = x*x
@@ -249,7 +249,7 @@ class MultiprocessingTest(CoverageTest):
if __name__ == "__main__":
pool = multiprocessing.Pool(3)
- inputs = range(20)
+ inputs = range(30)
outputs = pool.imap_unordered(func, inputs)
pids = set()
total = 0
@@ -264,8 +264,7 @@ class MultiprocessingTest(CoverageTest):
out = self.run_command(
"coverage run --concurrency=multiprocessing multi.py"
)
- os.system("cp .cov* /tmp")
- total = sum(x*x if x%2 else x*x*x for x in range(20))
+ total = sum(x*x if x%2 else x*x*x for x in range(30))
self.assertEqual(out.rstrip(), "3 pids, total = %d" % total)
self.run_command("coverage combine")