[Python-Dev] test_bind_port and test_find_unused_port fail due to missing SO_REUSEPORT when building Python 3.3.2-r2 (from portage) on 3.7.10-gentoo-r1 kernel
Greetings, learned Python devs! Apologies in advance if my message is misdirected. I'm building Python 3.3.2-r2 from Gentoo's Portage tree [1] and encountered two failed tests which probably should not have been attempted on my OS (Gentoo 3.7.10): test_bind_port and test_find_unused_port both use the SO_REUSEPORT socket option which, to the best of my knowledge is only available since kernel version 3.9. I was able to build by skipping the tests — but I believe the tests are there for a reason, and it would be best if a test that is known to fail should be skipped (or replaced with a fallback that is likely to succeed). Issue # 16594 [3] may be related (not sure). Is it possible to detect the kernel version and skip (or modify) these tests if SO_REUSEPORT is not available? If I'm missing something obvious (or should be reporting this elsewhere), please educate me so I can better respect your attention next time around :] +=== excerpt of portage build log: == ERROR: test_bind_port (test.test_support.TestSupport) -- Traceback (most recent call last): File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/test_support.py", line 87, in test_bind_port support.bind_port(s) File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", line 548, in bind_port if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: OSError: [Errno 92] Protocol not available == ERROR: test_find_unused_port (test.test_support.TestSupport) -- Traceback (most recent call last): File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/test_support.py", line 80, in test_find_unused_port port = support.find_unused_port() File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", line 522, in find_unused_port port = bind_port(tempsock) File "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", line 548, in bind_port if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: OSError: [Errno 92] Protocol not available ===+ [1]: https://packages.gentoo.org/package/dev-lang/python [2]: https://lwn.net/Articles/542629/ [3]: http://bugs.python.org/issue16594 -- Best regards, Reuben Garrett ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] test_bind_port and test_find_unused_port fail due to missing SO_REUSEPORT when building Python 3.3.2-r2 (from portage) on 3.7.10-gentoo-r1 kernel
Hi Reuben, Thanks for reporting this. I've had a similar report recently in the Tulip tracker (http://code.google.com/p/tulip/issues/detail?id=89). But the problem seems with the use of SO_REUSEPORT in the test.support package's bind_port() helper. This really belongs in the Python issue tracker (bugs.python.org) -- can you submit a bug there? My hunch is that, because this seems to be a relatively new feature, we should just catch and ignore the exception from that specific call. --Guido On Tue, Dec 3, 2013 at 7:24 AM, Reuben Garrett wrote: > Greetings, learned Python devs! > > Apologies in advance if my message is misdirected. I'm building Python > 3.3.2-r2 from Gentoo's Portage tree [1] and encountered two failed tests > which probably should not have been attempted on my OS (Gentoo 3.7.10): > test_bind_port and test_find_unused_port both use the SO_REUSEPORT socket > option which, to the best of my knowledge is only available since kernel > version 3.9. I was able to build by skipping the tests — but I believe the > tests are there for a reason, and it would be best if a test that is known > to fail should be skipped (or replaced with a fallback that is likely to > succeed). Issue # 16594 [3] may be related (not sure). > > Is it possible to detect the kernel version and skip (or modify) these > tests if SO_REUSEPORT is not available? If I'm missing something obvious > (or should be reporting this elsewhere), please educate me so I can better > respect your attention next time around :] > > > +=== excerpt of portage build log: > == > ERROR: test_bind_port (test.test_support.TestSupport) > -- > Traceback (most recent call last): > File > "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/test_support.py", > line 87, in test_bind_port > support.bind_port(s) > File > "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", > line 548, in bind_port > if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: > OSError: [Errno 92] Protocol not available > > == > ERROR: test_find_unused_port (test.test_support.TestSupport) > -- > Traceback (most recent call last): > File > "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/test_support.py", > line 80, in test_find_unused_port > port = support.find_unused_port() > File > "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", > line 522, in find_unused_port > port = bind_port(tempsock) > File > "/var/tmp/portage/dev-lang/python-3.3.2-r2/work/Python-3.3.2/Lib/test/support.py", > line 548, in bind_port > if sock.getsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT) == 1: > OSError: [Errno 92] Protocol not available > ===+ > > [1]: https://packages.gentoo.org/package/dev-lang/python > [2]: https://lwn.net/Articles/542629/ > [3]: http://bugs.python.org/issue16594 > > -- > Best regards, > Reuben Garrett > > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/guido%40python.org > > -- --Guido van Rossum (python.org/~guido) ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
[Python-Dev] Running the unit test as root/administrator
Greetings, comrades! Having handled these two issues personally: http://bugs.python.org/issue19877 - test related with symlink fails on Windows Vista with administrator account (in Windows NT 6, only account in administrator group can create symlink) http://bugs.python.org/issue18678 - bug in spwd module, which can be used only by root I believe there is a virtue of running the unit test as root/administrator to catch these errors automatically. Currently there is no unit test for spwd module. What do you say, comrades? --Vajrasky ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Running the unit test as root/administrator
I would be rather worried about some accidental Trojen running that way. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Running the unit test as root/administrator
On 03Dec2013 08:25, Guido van Rossum wrote: > I would be rather worried about some accidental Trojen running that way. Or even just a badly framed clean-up-temp-files step. -- Cameron Simpson manual, n.: A unit of documentation. There are always three or more on a given item. One is on the shelf; someone has the others. The information you need is in the others. - Ray Simard ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] Running the unit test as root/administrator
Just don't run it on Windows... On Tue, Dec 3, 2013 at 10:25 AM, Guido van Rossum wrote: > I would be rather worried about some accidental Trojen running that way. > > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/rymg19%40gmail.com > > -- Ryan When your hammer is C++, everything begins to look like a thumb. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com