[Python-Dev] test_posix, test_random failing
M.-A. Lemburg
mal@lemburg.com
Thu, 20 Feb 2003 15:06:36 +0100
Guido van Rossum wrote:
>>My nightly cronjob has issued two warnings for the CVS checkout
>>at 02:00 CET today:
>>
>>test test_posix failed -- Traceback (most recent call last):
>> File "/home/lemburg/projects/Python/Dev-Python/Lib/test/test_posix.py", line 39, in testNoArgFunctions
>> posix_func()
>>OSError: [Errno 25] Inappropriate ioctl for device
>>
>>The traceback is not very helpful I'm afraid and when I run the
>>test by hand I can't reproduce it.
>
> Try running the test from a cron job without regrtest (i.e. ./python
> Lib/test/test_posix.py), and putting some extra prints in it.
>
> Some of the functions tested (e.g. ctermid, getlogin) use stdin to
> determine who is logged in. Maybe these should just be ignored if
> they fail with this specific error (since the error means they're
> working as advertised).
Ok, here's the output:
testNoArgFunctions (__main__.PosixTester) ... Running function ctermid
Running function getcwd
Running function getcwdu
Running function uname
Running function times
Running function getlogin
ERROR
Running function getloadavg
Running function tmpnam
Running function getegid
Running function geteuid
Running function getgid
Running function getgroups
Running function getpid
Running function getpgrp
Running function getppid
Running function getuid
ok
Looks like getlogin doesn't like being run in non-interactive
mode (ie. without a terminal).
>>test test_random failed -- Traceback (most recent call last):
>> File "/home/lemburg/projects/Python/Dev-Python/Lib/test/test_random.py", line 25, in test_autoseed
>> self.assertNotEqual(state1, state2)
>> File "/home/lemburg/projects/Python/Dev-Python/Lib/unittest.py", line 300, in failIfEqual
>> raise self.failureException, \
>>AssertionError: (2, (1045703145, 318847470, 620640488, 320379787, -1732263717, -1278593374, ...
>
>
> This one I don't understand. Maybe the sleep(1) in the test isn't
> long enough?
I could not reproduce this, but perhaps using long(time.time()*256) isn't
safe enough to produce different states in the WH-generator ?! I'd
add a counter or hash the previous stored state to add some
more noise.
--
Marc-Andre Lemburg
eGenix.com
Professional Python Software directly from the Source (#1, Feb 20 2003)
>>> Python/Zope Products & Consulting ... http://www.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
Python UK 2003, Oxford: 40 days left
EuroPython 2003, Charleroi, Belgium: 124 days left