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
1=== modified file 'NEWS'
2--- NEWS 2010-03-05 07:49:31 +0000
3+++ NEWS 2010-03-05 08:54:20 +0000
4@@ -14,6 +14,9 @@
5 Bug Fixes
6 *********
7
8+* Fix stub sftp test server to call os.getcwdu().
9+ (Vincent Ladeuil, #526211, #526353)
10+
11 * Merge correctly when this_tree is not a WorkingTree. (Aaron Bentley)
12
13 * Register SIGWINCH handler only when creating a ``TextUIFactory``; avoids
14
15=== modified file 'bzrlib/tests/stub_sftp.py'
16--- bzrlib/tests/stub_sftp.py 2010-02-17 17:11:16 +0000
17+++ bzrlib/tests/stub_sftp.py 2010-03-05 08:54:20 +0000
18@@ -297,14 +297,14 @@
19 threading.Thread(target=self._callback, args=(s,)).start()
20 except socket.error, x:
21 sys.excepthook(*sys.exc_info())
22- warning('Socket error during accept() within unit test server'
23- ' thread: %r' % x)
24+ trace.warning('Socket error during accept() '
25+ 'within unit test server thread: %r' % x)
26 except Exception, x:
27 # probably a failed test; unit test thread will log the
28 # failure/error
29 sys.excepthook(*sys.exc_info())
30- warning('Exception from within unit test server thread: %r' %
31- x)
32+ trace.warning(
33+ 'Exception from within unit test server thread: %r' % x)
34
35
36 class SocketDelay(object):
37@@ -438,13 +438,15 @@
38 if not (backing_server is None or
39 isinstance(backing_server, local.LocalURLServer)):
40 raise AssertionError(
41- "backing_server should not be %r, because this can only serve the "
42- "local current working directory." % (backing_server,))
43+ 'backing_server should not be %r, because this can only serve '
44+ 'the local current working directory.' % (backing_server,))
45 self._original_vendor = ssh._ssh_vendor_manager._cached_ssh_vendor
46 ssh._ssh_vendor_manager._cached_ssh_vendor = self._vendor
47+ # FIXME: the following block should certainly just be self._homedir =
48+ # osutils.getcwd() but that fails badly on Unix -- vila 20100224
49 if sys.platform == 'win32':
50 # Win32 needs to use the UNICODE api
51- self._homedir = getcwd()
52+ self._homedir = os.getcwdu()
53 else:
54 # But Linux SFTP servers should just deal in bytestreams
55 self._homedir = os.getcwd()

Subscribers

People subscribed via source and target branches