classification
Title: test_posix failures - getpwduid()/initgroups()/getgroups()
Type: behavior Stage: resolved
Components: Tests Versions: Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: neologix, pitrou, python-dev
Priority: normal Keywords: buildbot, easy, needs review, patch

Created on 2012-04-30 08:30 by neologix, last changed 2012-06-25 19:20 by neologix. This issue is now closed.

Files
File name Uploaded Description Edit
test_no_pwd.diff neologix, 2012-04-30 08:30 review
Messages (2)
msg159677 - (view) Author: Charles-François Natali (neologix) * (Python committer) Date: 2012-04-30 08:30
test_posix is consistently failing on the bigmem buildbot:

http://python.org/dev/buildbot/all/builders/AMD64 debian bigmem 3.x/builds/291/steps/test/logs/stdio

"""
======================================================================
ERROR: test_getgrouplist (test.test_posix.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/test_posix.py", line 633, in test_getgrouplist
    set(posix.getgrouplist(pwd.getpwuid(os.getuid())[0],
KeyError: 'getpwuid(): uid not found: 5025'

======================================================================
ERROR: test_initgroups (test.test_posix.PosixTester)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/tmpfs/martin.vonloewis/3.x.loewis-parallel2/build/Lib/test/test_posix.py", line 111, in test_initgroups
    name = pwd.getpwuid(posix.getuid()).pw_name
KeyError: 'getpwuid(): uid not found: 5025'
"""

I assume that's because the buildbot tests run with a UID without any corresponding pwd entry (which is legit).
The attached patch should fix thoe failures, by making the tests more robust.
msg159811 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-05-02 18:05
New changeset 45f0272f5296 by Charles-François Natali in branch '2.7':
Issue #14698: Make test_posix more robust when the current UID doesn't have an
http://hg.python.org/cpython/rev/45f0272f5296

New changeset 93424b084d08 by Charles-François Natali in branch '3.2':
Issue #14698: Make test_posix more robust when the current UID doesn't have an
http://hg.python.org/cpython/rev/93424b084d08

New changeset 982c30064bc9 by Charles-François Natali in branch 'default':
Issue #14698: Make test_posix more robust when the current UID doesn't have an
http://hg.python.org/cpython/rev/982c30064bc9
History
Date User Action Args
2012-06-25 19:20:31neologixsetstatus: open -> closed
resolution: fixed
stage: resolved
2012-05-02 18:05:33python-devsetnosy: + python-dev
messages: + msg159811
2012-04-30 08:30:39neologixcreate