create_signature=always causes test suite failure

Bug #1622044 reported by Colin Watson
This bug affects 1 person
Affects Status Importance Assigned to Milestone
In Progress
Fix Released
Jelmer Vernooij

Bug Description

If one has create_signature = always (maybe also gpg_signing_key) set in the [DEFAULT] section of ~/.bazaar/bazaar.conf and runs the Bazaar test suite, it fails as follows:

FAIL: bzrlib.branchbuilder.BranchBuilder
Traceback (most recent call last):
testtools.testresult.real._StringException: Traceback (most recent call last):
  File "/usr/lib/python2.7/", line 2226, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for bzrlib.branchbuilder.BranchBuilder
  File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 30, in BranchBuilder

File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 45, in bzrlib.branchbuilder.BranchBuilder
Failed example:
    builder.build_snapshot('rev-id', None, [
        ('add', ('', 'root-id', 'directory', '')),
        ('add', ('filename', 'f-id', 'file', 'content\n'))])
Exception raised:
    Traceback (most recent call last):
      File "/usr/lib/python2.7/", line 1315, in __run
        compileflags, 1) in test.globs
      File "<doctest bzrlib.branchbuilder.BranchBuilder[3]>", line 3, in <module>
        ('add', ('filename', 'f-id', 'file', 'content\n'))])
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 259, in build_snapshot
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 127, in _do_commit
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 218, in write_locked
        result = unbound(self, *args, **kwargs)
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 211, in commit
        *args, **kwargs)
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 290, in commit
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 132, in run
        self.cleanups, self.func, self, *args, **kwargs)
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 166, in _do_with_cleanups
        result = func(*args, **kwargs)
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 447, in _commit
        self.rev_id = self.builder.commit(self.message)
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 208, in commit
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 218, in write_locked
        result = unbound(self, *args, **kwargs)
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 909, in store_revision_signature
        signature = gpg_strategy.sign(plaintext)
      File "/<<BUILDDIR>>/bzr-2.7.0+bzr6619/build/lib.linux-x86_64-2.7/bzrlib/", line 237, in sign
        raise errors.SigningFailed(self._command_line())
    SigningFailed: Failed to GPG sign data with command "[u'gpg', '--clearsign', '-u', u'7D86500B']"

Temporarily moving ~/.bazaar aside works around this.

The test suite should be properly isolated from whatever happens to be in the home directory of the user running it.

Related branches

Revision history for this message
Vincent Ladeuil (vila) wrote :

Different parts of the test suite use different sort of isolation.

Thanks for identifying this leak,

This is... a doctest... it's not properly isolated almost by design.

There are way better (and more complete) examples in other tests, starting with branchbuilder tests themselves, this is not worth attempting to teach doctest about isolation ;)

So I'll replace the doctest by better pointers.

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
milestone: none → 2.8b1
status: New → In Progress
Jelmer Vernooij (jelmer)
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Jelmer Vernooij (jelmer)
milestone: none → 3.0.0
status: Triaged → In Progress
Jelmer Vernooij (jelmer)
Changed in brz:
status: In Progress → Fix Released
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

This isn't actually fixed in brz yet, it still happens for the branchbuilder doctest.

Changed in brz:
status: Fix Released → Triaged
Jelmer Vernooij (jelmer)
Changed in brz:
status: Triaged → Fix Released
Vincent Ladeuil (vila)
Changed in bzr:
assignee: Vincent Ladeuil (vila) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.