From 13dd59ba5b3228820841682b59bad6c22476ff66 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Tue, 8 Jun 2010 17:25:43 +0200 Subject: task: now deletes itself once its done - for the test this doesn't change a thing as the task deletes itself too late - its time for a paradigm change, the task should be deleted with its RPoolChannel or explicitly by the user. The test needs to adapt, and shouldn't assume anything unless the RPoolChannel is gone --- test/git/async/test_pool.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/git/async/test_pool.py b/test/git/async/test_pool.py index 0aa8f39b..3077dc32 100644 --- a/test/git/async/test_pool.py +++ b/test/git/async/test_pool.py @@ -26,7 +26,9 @@ class TestThreadTaskNode(InputIteratorThreadTask): def reset(self, iterator): self.process_count = 0 self.item_count = 0 + self._exc = None self._iterator = iterator + self._done = False def process(self, count=1): # must do it first, otherwise we might read and check results before @@ -97,12 +99,13 @@ class TestThreadPool(TestBase): print "read(0)" items = rc.read() assert len(items) == ni - task._assert(1, ni).reset(make_iter()) + task._assert(1, ni) assert items[0] == 0 and items[-1] == ni-1 # as the task is done, it should have been removed - we have read everything assert task.is_done() assert p.num_tasks() == null_tasks + task.reset(make_iter()) # pull individual items rc = p.add_task(task) -- cgit v1.2.3