Rev 5296: Merge http-leaks into smart-server-leaks in file:///home/vila/src/bzr/experimental/leaking-tests/
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Jun 23 17:46:56 BST 2010
At file:///home/vila/src/bzr/experimental/leaking-tests/
------------------------------------------------------------
revno: 5296 [merge]
revision-id: v.ladeuil+lp at free.fr-20100623164656-3d05qk7c628jfrwm
parent: v.ladeuil+lp at free.fr-20100623160300-z48w54kqbe9dzvmf
parent: v.ladeuil+lp at free.fr-20100623164316-yffl9m72oh8jy46a
committer: Vincent Ladeuil <v.ladeuil+lp at free.fr>
branch nick: smart-server-leaks
timestamp: Wed 2010-06-23 18:46:56 +0200
message:
Merge http-leaks into smart-server-leaks
modified:
bzrlib/tests/http_server.py httpserver.py-20061012142527-m1yxdj1xazsf8d7s-1
bzrlib/tests/http_utils.py HTTPTestUtil.py-20050914180604-247d3aafb7a43343
bzrlib/tests/test_http.py testhttp.py-20051018020158-b2eef6e867c514d9
-------------- next part --------------
=== modified file 'bzrlib/tests/http_server.py'
--- a/bzrlib/tests/http_server.py 2010-06-05 09:01:06 +0000
+++ b/bzrlib/tests/http_server.py 2010-06-23 16:43:16 +0000
@@ -78,7 +78,7 @@
def handle(self):
SimpleHTTPServer.SimpleHTTPRequestHandler.handle(self)
# Some client (pycurl, I'm looking at you) are more picky than others
- # and require that the socket itself is close
+ # and require that the socket itself is closed
# (SocketServer.StreamRequestHandler only close the two associated
# 'makefile' objects)
self.connection.close()
=== modified file 'bzrlib/tests/http_utils.py'
--- a/bzrlib/tests/http_utils.py 2010-06-12 14:56:23 +0000
+++ b/bzrlib/tests/http_utils.py 2010-06-23 16:43:16 +0000
@@ -111,7 +111,7 @@
# These attributes can be overriden or parametrized by daughter clasess if
# needed, but must exist so that the create_transport_readonly_server()
- # method (or any method creating an http(s) server can propagate it.
+ # method (or any method creating an http(s) server) can propagate it.
_protocol_version = None
_url_protocol = 'http'
=== modified file 'bzrlib/tests/test_http.py'
--- a/bzrlib/tests/test_http.py 2010-06-12 14:56:23 +0000
+++ b/bzrlib/tests/test_http.py 2010-06-23 16:43:16 +0000
@@ -667,6 +667,10 @@
"""Fakes handling a single HTTP request, returns a bad status"""
ignored = http_server.TestingHTTPRequestHandler.parse_request(self)
self.wfile.write("Invalid status line\r\n")
+ # If we don't close the connection pycurl will hang. Since this is a
+ # stress test we don't *have* to respect the protocol, but we don't
+ # have to sabotage it too much either.
+ self.close_connection = True
return False
@@ -678,19 +682,6 @@
_req_handler_class = InvalidStatusRequestHandler
- def test_http_has(self):
- # FIXME: that should be fixed now, needs testing -- vila 20100611
- if self._testing_pycurl() and self._protocol_version == 'HTTP/1.1':
- raise tests.KnownFailure(
- 'pycurl hangs if the server send back garbage')
- super(TestInvalidStatusServer, self).test_http_has()
-
- def test_http_get(self):
- if self._testing_pycurl() and self._protocol_version == 'HTTP/1.1':
- raise tests.KnownFailure(
- 'pycurl hangs if the server send back garbage')
- super(TestInvalidStatusServer, self).test_http_get()
-
class BadProtocolRequestHandler(http_server.TestingHTTPRequestHandler):
"""Whatever request comes in, returns a bad protocol version"""
More information about the bazaar-commits
mailing list