selftest fails in Ubuntu 12.10 with test_apport_report

Bug #1107464 reported by Dylan McCall on 2013-01-28
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
High
Unassigned
bzr (Ubuntu)
Undecided
Unassigned

Bug Description

Running bzr selftest in Ubuntu 12.10, the following test seems to fail on every machine I have tried it on, always with the following error:

======================================================================
FAIL: bzrlib.tests.test_crash.TestApportReporting.test_apport_report
----------------------------------------------------------------------
_StringException: Empty attachments:
  log

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/tests/test_crash.py", line 57, in test_apport_report
    stderr)
  File "/usr/lib/python2.7/dist-packages/bzrlib/crash.py", line 127, in report_bug_to_apport
    crash_filename = _write_apport_report_to_file(exc_info)
  File "/usr/lib/python2.7/dist-packages/bzrlib/crash.py", line 173, in _write_apport_report_to_file
    pr['Locale'] = os.environ.get('LANG')
  File "/usr/lib/python2.7/dist-packages/problem_report.py", line 567, in __setitem__
    and (hasattr(v[0], 'isalnum') or hasattr(v[0], 'read'))))
AssertionError

----------------------------------------------------------------------
Ran 27987 tests in 293.810s

FAILED (failures=1, known_failure_count=59)
2763 tests skipped

I created an lxc container (sudo lxc-create -t ubuntu -n bzr-test) and ran bzr selftest in there. It skips test_crash, due to the missing dependencies, but every test that is run passes happily. After installing apport and python-apport, test_crash runs, and fails. The included error report is from bzr selftest run inside that lxc container.

Quickest way to reproduce this is the following:
bzr selftest --one -s bzrlib.tests.test_crash

ProblemType: Bug
DistroRelease: Ubuntu 12.10
Package: bzr 2.6.0~beta2-0ubuntu1
ProcVersionSignature: Ubuntu 3.5.0-22.34-generic 3.5.7.2
Uname: Linux 3.5.0-22-generic x86_64
ApportVersion: 2.6.1-0ubuntu9
Architecture: amd64
Date: Sun Jan 27 19:40:27 2013
InstallationDate: Installed on 2012-11-02 (86 days ago)
InstallationMedia: Ubuntu GNOME Remix 12.10 "Quantal Quetzal" - Release amd64(20121023)
MarkForUpload: True
PackageArchitecture: all
SourcePackage: bzr
UpgradeStatus: No upgrade log present (probably fresh install)

Related branches

Dylan McCall (dylanmccall) wrote :
description: updated
Dylan McCall (dylanmccall) wrote :

Oh, actually I'm seeing two issues here. Apport wants a file opened in binary mode for pr.write, but it was also failing in my lxc container for a _second_ reason:
pr['Locale'] = os.environ.get('LANG')
That causes a crash in a minimal environment, with the LANG variable unset, because apparently python-apport's Report class doesn't like when we set an empty value.

There are a 4 other failing tests, with the qbzr and builddeb plugins, but at least those ones aren't in core bzr :)

John A Meinel (jameinel) on 2013-02-07
Changed in bzr:
importance: Undecided → High
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers