Rev 2839: Remove some more http related noise from test suite output in file:///home/pqm/archives/thelove/bzr/%2Btrunk/

Canonical.com Patch Queue Manager pqm at pqm.ubuntu.com
Thu Sep 20 13:50:26 BST 2007


At file:///home/pqm/archives/thelove/bzr/%2Btrunk/

------------------------------------------------------------
revno: 2839
revision-id: pqm at pqm.ubuntu.com-20070920125023-upjqmzln7mjtvj1h
parent: pqm at pqm.ubuntu.com-20070920110135-652zsvb2su692bie
parent: v.ladeuil+lp at free.fr-20070920110551-tt5ds86wy2384w8a
committer: Canonical.com Patch Queue Manager <pqm at pqm.ubuntu.com>
branch nick: +trunk
timestamp: Thu 2007-09-20 13:50:23 +0100
message:
  Remove some more http related noise from test suite output
modified:
  bzrlib/tests/HttpServer.py     httpserver.py-20061012142527-m1yxdj1xazsf8d7s-1
    ------------------------------------------------------------
    revno: 2838.1.1
    merged: v.ladeuil+lp at free.fr-20070920110551-tt5ds86wy2384w8a
    parent: pqm at pqm.ubuntu.com-20070920110135-652zsvb2su692bie
    parent: v.ladeuil+lp at free.fr-20070920095526-ol9oqrq8vhv33wdm
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: bzr.integration
    timestamp: Thu 2007-09-20 13:05:51 +0200
    message:
      Remove some more http related noise from test suite output
    ------------------------------------------------------------
    revno: 2831.6.2
    merged: v.ladeuil+lp at free.fr-20070920095526-ol9oqrq8vhv33wdm
    parent: v.ladeuil+lp at free.fr-20070919014438-w65bobnp7lxa2ti4
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: http.server
    timestamp: Thu 2007-09-20 11:55:26 +0200
    message:
      Review feeback.
      
      * bzrlib/tests/HttpServer.py:
      (TestingHTTPRequestHandler._handle_one_request): Fix typo.
    ------------------------------------------------------------
    revno: 2831.6.1
    merged: v.ladeuil+lp at free.fr-20070919014438-w65bobnp7lxa2ti4
    parent: pqm at pqm.ubuntu.com-20070918045733-es6jch43pxvogvhj
    committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
    branch nick: http.server
    timestamp: Wed 2007-09-19 03:44:38 +0200
    message:
      Remove some more noise from test suite.
      
      * bzrlib/tests/HttpServer.py:
      (TestingHTTPRequestHandler.handle_one_request): Catch socket
      closing by client without polluting test suite.
=== modified file 'bzrlib/tests/HttpServer.py'
--- a/bzrlib/tests/HttpServer.py	2007-09-18 15:55:54 +0000
+++ b/bzrlib/tests/HttpServer.py	2007-09-20 11:05:51 +0000
@@ -60,10 +60,30 @@
     def handle_one_request(self):
         """Handle a single HTTP request.
 
+        We catch all socket errors occurring when the client close the
+        connection early to avoid polluting the test results.
+        """
+        try:
+            self._handle_one_request()
+        except socket.error, e:
+            if (len(e.args) > 0
+                and e.args[0] in (errno.EPIPE, errno.ECONNRESET,
+                                  errno.ECONNABORTED,)):
+                self.close_connection = 1
+                pass
+            else:
+                raise
+
+    def _handle_one_request(self):
+        """
+        Request handling as defined in the base class.
+
         You normally don't need to override this method; see the class
         __doc__ string for information on how to handle specific HTTP
         commands such as GET and POST.
 
+        On some platforms, notably OS X, a lot of EAGAIN (resource temporary
+        unavailable) occur. We retry silently at most 10 times.
         """
         for i in xrange(1,11): # Don't try more than 10 times
             try:




More information about the bazaar-commits mailing list