diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-06-07 10:38:22 +0200 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-06-07 10:38:22 +0200 |
commit | a8a448b7864e21db46184eab0f0a21d7725d074f (patch) | |
tree | e8bd0c6a27d4c611a0a380dabf894f67b8907566 /test/git/async/test_channel.py | |
parent | 6a252661c3bf4202a4d571f9c41d2afa48d9d75f (diff) | |
download | gitpython-a8a448b7864e21db46184eab0f0a21d7725d074f.tar.gz |
pool.consumed_tasks: is now a queue to be thread safe, in preparation for multiple connected pools
Reduced waiting time in tests to make them complete faster
Diffstat (limited to 'test/git/async/test_channel.py')
-rw-r--r-- | test/git/async/test_channel.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/test/git/async/test_channel.py b/test/git/async/test_channel.py index 6472b5b5..acfbd15e 100644 --- a/test/git/async/test_channel.py +++ b/test/git/async/test_channel.py @@ -22,14 +22,15 @@ class TestChannels(TestBase): wc.write(item2) # read all - it blocks as its still open for writing + to = 0.2 st = time.time() - assert rc.read(timeout=1) == [item, item2] - assert time.time() - st >= 1.0 + assert rc.read(timeout=to) == [item, item2] + assert time.time() - st >= to # next read blocks. it waits a second st = time.time() - assert len(rc.read(1, True, 1)) == 0 - assert time.time() - st >= 1.0 + assert len(rc.read(1, True, to)) == 0 + assert time.time() - st >= to # writing to a closed channel raises assert not wc.closed @@ -50,10 +51,10 @@ class TestChannels(TestBase): wc, rc = Channel(1) wc.write(item) # fine - # blocks for a second, its full + # blocks for a a moment, its full st = time.time() - self.failUnlessRaises(EOFError, wc.write, item, True, 1) - assert time.time() - st >= 1.0 + self.failUnlessRaises(EOFError, wc.write, item, True, to) + assert time.time() - st >= to # get our only one assert rc.read(1)[0] == item |