Merge lp:~vila/bzr/686008-spurious-https-failure into lp:bzr
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Vincent Ladeuil | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 5561 | ||||
Proposed branch: | lp:~vila/bzr/686008-spurious-https-failure | ||||
Merge into: | lp:bzr | ||||
Diff against target: |
66 lines (+18/-3) 3 files modified
bzrlib/tests/https_server.py (+12/-0) bzrlib/tests/test_server.py (+3/-3) doc/en/release-notes/bzr-2.3.txt (+3/-0) |
||||
To merge this branch: | bzr merge lp:~vila/bzr/686008-spurious-https-failure | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Martin Packman (community) | Approve | ||
Review via email: mp+42969@code.launchpad.net |
Commit message
Catch spurious and bogus ssl TypeError exceptions.
Description of the change
This fixes bug #686008 by making sure we're not affected by bug
#637821 for python versions that didn't get spiv's patch. In
other words: in some cases, during cleanup of tests involving an
https server, we get a TypeError exception while trying to read a
closed ssl socket instead of a socket.error.
Various tests has been affected by this bug making selftest
itself unreliable since the failure was rarely on the same test
nor even the same platform.
I was able to trigger the bug with a test but unfortunately not
in a reproducible way :-/ It needed no less than 3 breakpoints,
some prints and a bit of luck...
Anyhow, the fix itself is reduced enough in scope that it should
never mask real failures (this occurs only during a test cleanup
and has no effect on test validity).
So the fix works but since I can't trigger it on demand (and it
has served its purpose which was to check the exception), I've
removed the test from the proposal, here it is for the curious:
class TestBug686008(
_test_
def test_it(self):
from bzrlib.tests import https_server
import ssl
trigger_bug = False
class RequestHandler(
def handle_
if trigger_bug:
def do_HEAD(self):
# Always succeds, leaving the connection open
server = https_server.
t = _urllib.
# We need a first clean request
# Now we force the server to choke
trigger_bug = True
Looks sane to me. Grammar nit:
- ...same one than TestingTCPServer...
+ ...same one as TestingTCPServer...