diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-09 10:34:12 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-09 10:34:12 +0200 |
commit | 15941ca090a2c3c987324fc911bbc6f89e941c47 (patch) | |
tree | 3c508eb2e8be484e8685cddaa1de72826fbf9302 /test/git/async/test_pool.py | |
parent | f78d4a28f307a9d7943a06be9f919304c25ac2d9 (diff) | |
download | gitpython-15941ca090a2c3c987324fc911bbc6f89e941c47.tar.gz |
queue: fixed critical bug in the notify method, as it was not at all thread-safe, causing locks to be released multiple times. Now it runs very fast, and very stable apparently.
Now its about putting previous features back in, and studying their results, before more complex task graphs can be examined
Diffstat (limited to 'test/git/async/test_pool.py')
-rw-r--r-- | test/git/async/test_pool.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/test/git/async/test_pool.py b/test/git/async/test_pool.py index 756f1562..ac8f1244 100644 --- a/test/git/async/test_pool.py +++ b/test/git/async/test_pool.py @@ -74,7 +74,7 @@ class TestThreadPool(TestBase): # add a simple task # it iterates n items - ni = 1000 + ni = 5000 assert ni % 2 == 0, "ni needs to be dividable by 2" assert ni % 4 == 0, "ni needs to be dividable by 4" @@ -148,7 +148,7 @@ class TestThreadPool(TestBase): print "read(%i)" % nri items = rc.read(nri) assert len(items) == nri - p.del_task(task) + p.remove_task(task) assert p.num_tasks() == null_tasks task._assert(2, ni) # two chunks, ni calls @@ -204,7 +204,7 @@ class TestThreadPool(TestBase): task._assert(ni, ni) assert p.num_tasks() == 1 + null_tasks - assert p.del_task(task) is p # del manually this time + assert p.remove_task(task) is p # del manually this time assert p.num_tasks() == null_tasks # now with we set the minimum count to reduce the number of processing counts @@ -231,7 +231,7 @@ class TestThreadPool(TestBase): rc = p.add_task(task) print "read(0) with failure" assert len(rc.read()) == 0 # failure on first item - print "done with everything" + print >> sys.stderr, "done with everything" assert isinstance(task.error(), AssertionError) assert task.is_done() # on error, its marked done as well del(rc) @@ -290,7 +290,7 @@ class TestThreadPool(TestBase): # deleting the pool stops its threads - just to be sure ;) # Its not synchronized, hence we wait a moment del(p) - time.sleep(0.15) + time.sleep(0.25) assert len(threading.enumerate()) == num_threads p = ThreadPool(1) @@ -311,7 +311,6 @@ class TestThreadPool(TestBase): # threads per core p.set_size(4) self._assert_single_task(p, True) - # DEPENDENT TASK ASYNC MODE ########################### self._assert_async_dependent_tasks(p) |