diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-08 19:25:33 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-08 19:25:33 +0200 |
commit | 772b95631916223e472989b43f3a31f61e237f31 (patch) | |
tree | cac3b488a05502b15532b07bb3848e0fdb2df339 /test/git/async | |
parent | e5c0002d069382db1768349bf0c5ff40aafbf140 (diff) | |
download | gitpython-772b95631916223e472989b43f3a31f61e237f31.tar.gz |
workerthread: adjusted to use a blocking queue, it will receive termination events only with its queue, with boosts performance into brigt green levels
Diffstat (limited to 'test/git/async')
-rw-r--r-- | test/git/async/test_pool.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/git/async/test_pool.py b/test/git/async/test_pool.py index 82947988..756f1562 100644 --- a/test/git/async/test_pool.py +++ b/test/git/async/test_pool.py @@ -69,11 +69,12 @@ class TestThreadPool(TestBase): def _assert_single_task(self, p, async=False): """Performs testing in a synchronized environment""" + print >> sys.stderr, "Threadpool: Starting single task (async = %i) with %i threads" % (async, p.size()) null_tasks = p.num_tasks() # in case we had some before # add a simple task # it iterates n items - ni = 52 + ni = 1000 assert ni % 2 == 0, "ni needs to be dividable by 2" assert ni % 4 == 0, "ni needs to be dividable by 4" @@ -287,7 +288,9 @@ class TestThreadPool(TestBase): p.set_size(1) assert len(threading.enumerate()) == num_threads + 1 # deleting the pool stops its threads - just to be sure ;) + # Its not synchronized, hence we wait a moment del(p) + time.sleep(0.15) assert len(threading.enumerate()) == num_threads p = ThreadPool(1) |