You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/01/27 21:08:55 UTC
qpid-proton git commit: NO-JIRA: Ad timeouts to utils
test_request_response.
Repository: qpid-proton
Updated Branches:
refs/heads/master 425ac5e62 -> 9ee7bb190
NO-JIRA: Ad timeouts to utils test_request_response.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/9ee7bb19
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/9ee7bb19
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/9ee7bb19
Branch: refs/heads/master
Commit: 9ee7bb1905efe09a12711192d89c8f54fa17a600
Parents: 425ac5e
Author: Alan Conway <ac...@redhat.com>
Authored: Tue Jan 27 15:08:46 2015 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Tue Jan 27 15:08:46 2015 -0500
----------------------------------------------------------------------
tests/python/proton_tests/utils.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/9ee7bb19/tests/python/proton_tests/utils.py
----------------------------------------------------------------------
diff --git a/tests/python/proton_tests/utils.py b/tests/python/proton_tests/utils.py
index 101cd9f..5cd119c 100644
--- a/tests/python/proton_tests/utils.py
+++ b/tests/python/proton_tests/utils.py
@@ -34,9 +34,11 @@ class EchoServer(MessagingHandler, Thread):
Will only accept a single connection and shut down when that connection closes.
"""
- def __init__(self, url):
+ def __init__(self, url, timeout):
MessagingHandler.__init__(self)
Thread.__init__(self)
+ self.daemon = True
+ self.timeout = timeout
self.url = url
self.senders = {}
self.container = None
@@ -67,8 +69,8 @@ class EchoServer(MessagingHandler, Thread):
def run(self):
Container(self).run()
- def wait(self, timeout):
- self.event.wait(timeout)
+ def wait(self):
+ self.event.wait(self.timeout)
class SyncRequestResponseTest(Test):
@@ -82,12 +84,13 @@ class SyncRequestResponseTest(Test):
self.assertEquals(response.address, client.reply_to)
self.assertEquals(response.body, body)
- server = EchoServer(Url(host="127.0.0.1", port=free_tcp_port()))
+ server = EchoServer(Url(host="127.0.0.1", port=free_tcp_port()), self.timeout)
server.start()
- server.wait(self.timeout)
+ server.wait()
connection = BlockingConnection(server.url, timeout=self.timeout)
client = SyncRequestResponse(connection)
try:
test("foo") # Simple request/resposne
finally:
client.connection.close()
+ server.join(timeout=self.timeout)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org