Merge lp:~vila/bzr/526221-failing-sftp-tests-2.1 into lp:bzr/2.1

Proposed by Vincent Ladeuil
Status: Merged
Merged at revision: not available
Proposed branch: lp:~vila/bzr/526221-failing-sftp-tests-2.1
Merge into: lp:bzr/2.1
Diff against target: 55 lines (+12/-7)
2 files modified
NEWS (+3/-0)
bzrlib/tests/stub_sftp.py (+9/-7)
To merge this branch: bzr merge lp:~vila/bzr/526221-failing-sftp-tests-2.1
Reviewer Review Type Date Requested Status
Alexander Belchenko Approve
bzr-core Pending
Review via email: mp+20725@code.launchpad.net

Description of the change

This patch backports the fix for bug #526211 and bug #526353 to the 2.1 series.
The intent is to ensure better testing there since it has been a problem for at
least one plugin author (https://bugs.edge.launchpad.net/bzr/2.1/+bug/526221/comments/3)

Since it's trivial and concern only tests, I don't think it violates our
stable release landings policy (in retrospect, I should of course have
proposed it against 2.1 from the start).

To post a comment you must log in.
Revision history for this message
Alexander Belchenko (bialix) wrote :

Thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'NEWS'
--- NEWS 2010-03-05 07:49:31 +0000
+++ NEWS 2010-03-05 08:54:20 +0000
@@ -14,6 +14,9 @@
14Bug Fixes14Bug Fixes
15*********15*********
1616
17* Fix stub sftp test server to call os.getcwdu().
18 (Vincent Ladeuil, #526211, #526353)
19
17* Merge correctly when this_tree is not a WorkingTree. (Aaron Bentley)20* Merge correctly when this_tree is not a WorkingTree. (Aaron Bentley)
1821
19* Register SIGWINCH handler only when creating a ``TextUIFactory``; avoids22* Register SIGWINCH handler only when creating a ``TextUIFactory``; avoids
2023
=== modified file 'bzrlib/tests/stub_sftp.py'
--- bzrlib/tests/stub_sftp.py 2010-02-17 17:11:16 +0000
+++ bzrlib/tests/stub_sftp.py 2010-03-05 08:54:20 +0000
@@ -297,14 +297,14 @@
297 threading.Thread(target=self._callback, args=(s,)).start()297 threading.Thread(target=self._callback, args=(s,)).start()
298 except socket.error, x:298 except socket.error, x:
299 sys.excepthook(*sys.exc_info())299 sys.excepthook(*sys.exc_info())
300 warning('Socket error during accept() within unit test server'300 trace.warning('Socket error during accept() '
301 ' thread: %r' % x)301 'within unit test server thread: %r' % x)
302 except Exception, x:302 except Exception, x:
303 # probably a failed test; unit test thread will log the303 # probably a failed test; unit test thread will log the
304 # failure/error304 # failure/error
305 sys.excepthook(*sys.exc_info())305 sys.excepthook(*sys.exc_info())
306 warning('Exception from within unit test server thread: %r' %306 trace.warning(
307 x)307 'Exception from within unit test server thread: %r' % x)
308308
309309
310class SocketDelay(object):310class SocketDelay(object):
@@ -438,13 +438,15 @@
438 if not (backing_server is None or438 if not (backing_server is None or
439 isinstance(backing_server, local.LocalURLServer)):439 isinstance(backing_server, local.LocalURLServer)):
440 raise AssertionError(440 raise AssertionError(
441 "backing_server should not be %r, because this can only serve the "441 'backing_server should not be %r, because this can only serve '
442 "local current working directory." % (backing_server,))442 'the local current working directory.' % (backing_server,))
443 self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor443 self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor
444 ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor444 ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor
445 # FIXME: the following block should certainly just be self._homedir =
446 # osutils.getcwd() but that fails badly on Unix -- vila 20100224
445 if sys.platform == 'win32':447 if sys.platform == 'win32':
446 # Win32 needs to use the UNICODE api448 # Win32 needs to use the UNICODE api
447 self._homedir = getcwd()449 self._homedir = os.getcwdu()
448 else:450 else:
449 # But Linux SFTP servers should just deal in bytestreams451 # But Linux SFTP servers should just deal in bytestreams
450 self._homedir = os.getcwd()452 self._homedir = os.getcwd()

Subscribers

People subscribed via source and target branches