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
=== modified file 'lib/lp/codehosting/tests/test_rewrite.py'
--- lib/lp/codehosting/tests/test_rewrite.py 2019-05-22 14:57:45 +0000
+++ lib/lp/codehosting/tests/test_rewrite.py 2019-06-01 06:15:15 +0000
@@ -346,8 +346,8 @@
346 if result.endswith('\n'):346 if result.endswith('\n'):
347 return result[:-1]347 return result[:-1]
348 self.fail(348 self.fail(
349 "Incomplete line or no result retrieved from subprocess: %s"349 "Incomplete line or no result retrieved from subprocess: %r"
350 % repr(result.getvalue()))350 % result)
351351
352 def test_reconnects_when_disconnected(self):352 def test_reconnects_when_disconnected(self):
353 pgbouncer = self.useFixture(PGBouncerFixture())353 pgbouncer = self.useFixture(PGBouncerFixture())