Merge lp:~cjwatson/launchpad/test-rewrite-fail-crash into lp:launchpad

Proposed by Colin Watson
Status: Merged
Merged at revision: 18976
Proposed branch: lp:~cjwatson/launchpad/test-rewrite-fail-crash
Merge into: lp:launchpad
Diff against target: 14 lines (+2/-2)
1 file modified
lib/lp/codehosting/tests/test_rewrite.py (+2/-2)
To merge this branch: bzr merge lp:~cjwatson/launchpad/test-rewrite-fail-crash
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+368220@code.launchpad.net

Commit message

Fix crash in TestBranchRewriterScriptHandlesDisconnects.request failures.

Description of the change

nonblocking_readline returns result.getvalue() itself, so calling getvalue again doesn't make sense.

This is in a failure path, so it only comes up if something else is wrong, but I happened to have /var/tmp/bazaar.launchpad.test/rewrite.log with bad ownership in a test container and thus ran into this.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/codehosting/tests/test_rewrite.py'
2--- lib/lp/codehosting/tests/test_rewrite.py 2019-05-22 14:57:45 +0000
3+++ lib/lp/codehosting/tests/test_rewrite.py 2019-06-01 06:15:15 +0000
4@@ -346,8 +346,8 @@
5 if result.endswith('\n'):
6 return result[:-1]
7 self.fail(
8- "Incomplete line or no result retrieved from subprocess: %s"
9- % repr(result.getvalue()))
10+ "Incomplete line or no result retrieved from subprocess: %r"
11+ % result)
12
13 def test_reconnects_when_disconnected(self):
14 pgbouncer = self.useFixture(PGBouncerFixture())