create_safety_net is brittle
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Vincent Ladeuil |
Bug Description
mthaddon encountered a very weird failure when debugging the new pqm install.
All tests were failing with:
KeyError: 'getpwuid(): uid not found: 2005'
with a backtrace including:
Traceback (most recent call last):
File "/usr/lib/
function(
File "/home/
if (t.get_
File "/home/
f = self.get(relpath)
File "/home/
self.
File "/home/
raise errors.
NoSuchFile: No such file: u'/tmp/
i.e. somthing really wrong has happened when creating the safety net.
Indeed in the first test involving the safety net we had:
Traceback (most recent call last):
File "/usr/lib/
return fn(*args)
File "/usr/lib/
self.setUp()
File "/home/
super(
File "/home/
super(
File "/home/
self.
File "/home/
self.
File "/home/
wt = bzrdir.
File "/home/
format=
File "/home/
bzrdir = BzrDir.create(base, format)
File "/home/
return format.
File "/home/
return self._initializ
File "/home/
control_
File "/home/
token_from_lock = self._lock.
File "/home/
return self.wait_lock()
File "/home/
return self.attempt_lock()
File "/home/
result = self._attempt_
File "/home/
tmpname = self._create_
File "/home/
info = LockHeldInfo.
File "/home/
user=
File "/home/
return config.
File "/home/
super(
File "/home/
return osutils.
File "/home/
xdg_dir = osutils.
File "/usr/lib/
userhome = pwd.getpwuid(
KeyError: 'getpwuid(): uid not found: 2005'
While this is a bug in the chroot setup (the user running the
tests wasn't declared in /etc/passwd, something pretty hard to
encounter in real life), I think we should be more robust here if
only to make the diagnosis easier (in the pqm case, all output
was in the subunit format and redirected to a temp file).
Related branches
- John A Meinel: Needs Information
- Jonathan Lange: Pending requested
- Robert Collins: Pending requested
-
Diff: 36 lines (+14/-1)2 files modifiedbzrlib/tests/__init__.py (+10/-1)
doc/en/release-notes/bzr-2.4.txt (+4/-0)
Changed in bzr: | |
assignee: | nobody → Vincent Ladeuil (vila) |
status: | Confirmed → In Progress |
Changed in bzr: | |
milestone: | none → 2.4.1 |
status: | In Progress → Fix Released |
To debug selftest in a new environment, it's better to use:
bzr selftest -1
In the case at hand, the selftest would have failed far earlier (-1 tells selftest to stop on first failure).
On the other hand, -1 behaviour could be forced in 'create_safety_net' if a problem occurs as there is no point to keep running in this case.