Test failures when running as root
And now for something completely different. My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new "NAT Network" mode does. Why? I have no idea. But if anyone else is having the same problem, upgrade to the latest VirtualBox and set up a NAT Network. All I care is, it now works.) The test suite is now failing at another point, and this applies to 2.7, 3.3, and 3.x. ====================================================================== ERROR: test_initgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_posix.py", line 1143, in test_initgroups g = max(self.saved_groups) + 1 ValueError: max() arg is an empty sequence ---------------------------------------------------------------------- The saved_groups value comes from posix.getgroups(), and it's being used to try to get a group that this user doesn't have (I think). When I run Python as root, posix.getgroups() returns [0], but apparently it's not returning any groups when the test runs. So, two questions. Firstly, is this a problem that needs to be fixed in Python, or is it a configuration change that I made? It began failing recently, so possibly when I rebooted the VM as part of VirtualBox changes I mucked something up. And secondly, how can I run the tests manually? I can't find a binary inside the buildarea tree. Does it get deleted afterward? Apologies if these are dumb questions, hopefully they're a small distraction from PEP 460 arguments! ChrisA
On 1/13/2014 7:48 PM, Chris Angelico wrote:
And now for something completely different.
My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new "NAT Network" mode does. Why? I have no idea. But if anyone else is having the same problem, upgrade to the latest VirtualBox and set up a NAT Network. All I care is, it now works.) The test suite is now failing at another point, and this applies to 2.7, 3.3, and 3.x.
====================================================================== ERROR: test_initgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_posix.py", line 1143, in test_initgroups g = max(self.saved_groups) + 1 ValueError: max() arg is an empty sequence
try: g = max(self.saved_groups) + 1 except ValueError: g = 1
The saved_groups value comes from posix.getgroups(), and it's being used to try to get a group that this user doesn't have (I think). When I run Python as root, posix.getgroups() returns [0], but apparently it's not returning any groups when the test runs.
Unless someone says that it is a bug for posix.getgroups to return an empty list, I would say that the test should be fixed by trying the code above.
So, two questions. Firstly, is this a problem that needs to be fixed in Python, or is it a configuration change that I made? It began failing recently, so possibly when I rebooted the VM as part of VirtualBox changes I mucked something up.
And secondly, how can I run the tests manually?
If you build and keep a binary, it is easy. For example: path-to-binary -m test text_posix See doc chapter for test package and for 2.7 difference.
I can't find a binary inside the buildarea tree. Does it get deleted afterward?
No experience with bbots.
Apologies if these are dumb questions, hopefully they're a small distraction from PEP 460 arguments!
And welcomed. -- Terry Jan Reedy
On 2014-01-14 03:03, Terry Reedy wrote:
On 1/13/2014 7:48 PM, Chris Angelico wrote:
And now for something completely different.
My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new "NAT Network" mode does. Why? I have no idea. But if anyone else is having the same problem, upgrade to the latest VirtualBox and set up a NAT Network. All I care is, it now works.) The test suite is now failing at another point, and this applies to 2.7, 3.3, and 3.x.
====================================================================== ERROR: test_initgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_posix.py", line 1143, in test_initgroups g = max(self.saved_groups) + 1 ValueError: max() arg is an empty sequence
try: g = max(self.saved_groups) + 1 except ValueError: g = 1
Alternatively: g = max(self.saved_groups, [1]) or even: g = max(self.saved_groups or [1])
On Tue, Jan 14, 2014 at 2:16 PM, MRAB <python@mrabarnett.plus.com> wrote:
Alternatively:
g = max(self.saved_groups, [1])
or even:
g = max(self.saved_groups or [1])
Patch created and tracker issue opened. I've used something similar to MRAB's idea as it looks compact. Thanks all! http://bugs.python.org/issue20249 Is the patch in the right format? I'm not familiar with hg, so I just looked up a git<->hg Rosetta Stone that told me to use 'hg export'. The patch works with 'hg import' on 2.7 and 3.3. ChrisA
On 1/13/2014 10:16 PM, MRAB wrote:
On 2014-01-14 03:03, Terry Reedy wrote:
On 1/13/2014 7:48 PM, Chris Angelico wrote:
And now for something completely different.
My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new "NAT Network" mode does. Why? I have no idea. But if anyone else is having the same problem, upgrade to the latest VirtualBox and set up a NAT Network. All I care is, it now works.) The test suite is now failing at another point, and this applies to 2.7, 3.3, and 3.x.
====================================================================== ERROR: test_initgroups (test.test_posix.PosixGroupsTester) ---------------------------------------------------------------------- Traceback (most recent call last): File "/root/buildarea/3.x.angelico-debian-amd64/build/Lib/test/test_posix.py",
line 1143, in test_initgroups g = max(self.saved_groups) + 1 ValueError: max() arg is an empty sequence
try: g = max(self.saved_groups) + 1 except ValueError: g = 1
Alternatively:
g = max(self.saved_groups, [1])
This would be [1] instead of 1.
or even:
g = max(self.saved_groups or [1])
This is 1. -- Terry Jan Reedy
On Tue, Jan 14, 2014 at 2:03 PM, Terry Reedy <tjreedy@udel.edu> wrote:
On 1/13/2014 7:48 PM, Chris Angelico wrote:
ValueError: max() arg is an empty sequence
try:
g = max(self.saved_groups) + 1 except ValueError: g = 1
Unless someone says that it is a bug for posix.getgroups to return an empty list, I would say that the test should be fixed by trying the code above.
I can't see anything in the getgroups man page [1] to suggest that it's a bug to return an empty list. But I can't replicate the behaviour either - not on the system Python, at least (2.7.3), hence the query about rerunning tests. Will raise an issue on the tracker. [1] eg http://linux.die.net/man/2/getgroups ChrisA
On Mon, Jan 13, 2014 at 6:48 PM, Chris Angelico <rosuav@gmail.com> wrote:
And secondly, how can I run the tests manually? I can't find a binary inside the buildarea tree. Does it get deleted afterward?
Yes, that's the 'clean' step of the buildbot build process. I'd suggest making another clone elsewhere (you can clone from the buildarea just to make the clone faster, but I'd leave the buildarea alone otherwise), then building and testing should be as simple as `./configure --with-pydebug && make && ./python -m test.test_posix`. As far as the failure itself, I have no comment.
Apologies if these are dumb questions, hopefully they're a small distraction from PEP 460 arguments!
It's kinda nice to get something non-PEP460 in the inbox this week :) -- Zach
On Tue, Jan 14, 2014 at 2:14 PM, Zachary Ware <zachary.ware+pydev@gmail.com> wrote:
On Mon, Jan 13, 2014 at 6:48 PM, Chris Angelico <rosuav@gmail.com> wrote:
And secondly, how can I run the tests manually? I can't find a binary inside the buildarea tree. Does it get deleted afterward?
Yes, that's the 'clean' step of the buildbot build process. I'd suggest making another clone elsewhere (you can clone from the buildarea just to make the clone faster, but I'd leave the buildarea alone otherwise), then building and testing should be as simple as `./configure --with-pydebug && make && ./python -m test.test_posix`.
Doh. Yeah, I can see the 'clean' step in the build process, I should have known. Of course. Thanks, that's what I'll do then. ChrisA
participants (4)
-
Chris Angelico
-
MRAB
-
Terry Reedy
-
Zachary Ware