← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Colin Watson has proposed merging lp:~cjwatson/launchpad/test-rewrite-fail-crash into lp:launchpad.

Commit message:
Fix crash in TestBranchRewriterScriptHandlesDisconnects.request failures.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~cjwatson/launchpad/test-rewrite-fail-crash/+merge/368220

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.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~cjwatson/launchpad/test-rewrite-fail-crash into lp:launchpad.
=== 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 @@
         if result.endswith('\n'):
             return result[:-1]
         self.fail(
-            "Incomplete line or no result retrieved from subprocess: %s"
-            % repr(result.getvalue()))
+            "Incomplete line or no result retrieved from subprocess: %r"
+            % result)
 
     def test_reconnects_when_disconnected(self):
         pgbouncer = self.useFixture(PGBouncerFixture())


Follow ups