summaryrefslogtreecommitdiff
path: root/test/git/async/test_pool.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-06-08 10:45:14 +0200
committerSebastian Thiel <byronimo@gmail.com>2010-06-08 10:45:21 +0200
commit09c3f39ceb545e1198ad7a3f470d4ec896ce1add (patch)
tree69791486c0a8b12e3fed81e12ce2e367d2521f83 /test/git/async/test_pool.py
parent5d996892ac76199886ba3e2754ff9c9fac2456d6 (diff)
downloadgitpython-09c3f39ceb545e1198ad7a3f470d4ec896ce1add.tar.gz
both versions of the async queue still have trouble in certain situations, at least with my totally overwritten version of the condition - the previous one was somewhat more stable it seems. Nonetheless, this is the fastest version so far
Diffstat (limited to 'test/git/async/test_pool.py')
-rw-r--r--test/git/async/test_pool.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/test/git/async/test_pool.py b/test/git/async/test_pool.py
index 0d779f39..4c20a9b2 100644
--- a/test/git/async/test_pool.py
+++ b/test/git/async/test_pool.py
@@ -136,8 +136,9 @@ class TestThreadPool(TestBase):
# rest - it has ni/2 - 2 on the queue, and pulls ni-2
# It wants too much, so the task realizes its done. The task
# doesn't care about the items in its output channel
- items = rc.read(ni-2)
- assert len(items) == ni - 2
+ nri = ni-2
+ items = rc.read(nri)
+ assert len(items) == nri
assert p.num_tasks() == null_tasks
task._assert(2, ni) # two chunks, ni calls
@@ -152,11 +153,14 @@ class TestThreadPool(TestBase):
# must read a specific item count
# count is still at ni / 2 - here we want more than that
# 2 steps with n / 4 items, + 1 step with n/4 items to get + 2
- assert len(rc.read(ni / 2 + 2)) == ni / 2 + 2
+ nri = ni / 2 + 2
+ items = rc.read(nri)
+ assert len(items) == nri
# have n / 4 - 2 items on queue, want n / 4 in first chunk, cause 1 processing
# ( 4 in total ). Still want n / 4 - 2 in second chunk, causing another processing
- items = rc.read(ni / 2 - 2)
- assert len(items) == ni / 2 - 2
+ nri = ni / 2 - 2
+ items = rc.read(nri)
+ assert len(items) == nri
task._assert( 5, ni)
assert p.num_tasks() == null_tasks # depleted