trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jackso...@apache.org
Subject [trafficserver-qa] branch master updated: Add error to startup of DynamicHTTPEndpointCase
Date Thu, 03 Nov 2016 16:41:46 GMT
This is an automated email from the ASF dual-hosted git repository.

jacksontj pushed a commit to branch master
in repository https://git-dual.apache.org/repos/asf/trafficserver-qa.git

The following commit(s) were added to refs/heads/master by this push:
       new  f2b265e   Add error to startup of DynamicHTTPEndpointCase
f2b265e is described below

commit f2b265e1e3bdca990dae441ba81db0a1bde1df10
Author: Thomas Jackson <jacksontj.89@gmail.com>
AuthorDate: Thu Nov 3 09:39:50 2016 -0700

    Add error to startup of DynamicHTTPEndpointCase
---
 tsqa/endpoint.py   | 15 ++++++++++-----
 tsqa/test_cases.py |  2 ++
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git a/tsqa/endpoint.py b/tsqa/endpoint.py
index a2db090..993125b 100644
--- a/tsqa/endpoint.py
+++ b/tsqa/endpoint.py
@@ -119,6 +119,8 @@ class DynamicHTTPEndpoint(threading.Thread):
         threading.Thread.__init__(self)
         # dict to store request data in
         self._tracked_requests = {}
+        # error in startup
+        self.error = None
 
         self.daemon = True
         self.port = port
@@ -221,11 +223,14 @@ class DynamicHTTPEndpoint(threading.Thread):
         return 'http://127.0.0.1:{0}{1}'.format(self.address[1], path)
 
     def run(self):
-        self.server = make_server('',
-                                  self.port,
-                                  self.app.wsgi_app)
-        # mark the socket as SO_REUSEADDR
-        self.server.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        try:
+            self.server = make_server('',
+                                      self.port,
+                                      self.app.wsgi_app)
+            # mark the socket as SO_REUSEADDR
+            self.server.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        except Exception as e:
+            self.error = e
         # mark it as ready
         self.ready.set()
         # serve it
diff --git a/tsqa/test_cases.py b/tsqa/test_cases.py
index 3849d6a..b145df2 100644
--- a/tsqa/test_cases.py
+++ b/tsqa/test_cases.py
@@ -189,6 +189,8 @@ class DynamicHTTPEndpointCase(unittest.TestCase):
         cls.http_endpoint.start()
 
         cls.http_endpoint.ready.wait()
+        if cls.http_endpoint.error is not None:
+            raise unittest.SkipTest('Error starting DynamicHTTPEndpoint: {0}'.format(e))
 
         # Do this last, so we can get our stuff registered
         # call parent constructor

-- 
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <commits@trafficserver.apache.org>'].

Mime
View raw message