[issue5025] test_kqueue failure on OS X

Jean-Paul Calderone report at bugs.python.org
Wed Jan 21 19:04:52 CET 2009


Jean-Paul Calderone <exarkun at divmod.com> added the comment:

> My first impression was that the '1' in 'kq.control(None, 4, 1)'
already did this;  i.e., that it meant that the kq.control function
would wait up to 1 second for a response, but that doesn't seem to be true.

Since there are events in the result, the call succeeds immediately. 
The timeout only defines an upper bound on how long control will block
before returning with *no* results.  Since the loop doesn't handle any
of the events, there's always some ready right away after the first call.

> Out of curiosity, *why* is there a need to call this several times?

It's out of the control of the test what the kernel does to deliver the
event notifications.  Since the test is waiting for multiple events, the
loop helps it get them all (although clearly it's not totally reliable).

----------
nosy: +exarkun

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5025>
_______________________________________


More information about the Python-bugs-list mailing list