[issue20910] Make sleep configurable in tests

Nick Coghlan report at bugs.python.org
Thu Mar 13 23:42:18 CET 2014


Nick Coghlan added the comment:

I've sped up "wait for something to happen" tests in other contexts and
found the best solution to be a polling loop so that success is as fast as
possible and failure may be slow.

For example, rather than just having a 10 second timeout, it's often better
to have a 500 ms timeout, and keep trying again until the overall 10 second
deadline has expired.

This means the worst case tolerance for slow systems can be increased
without hurting test speed on fast systems (assuming you don't break the
test).

I haven't looked at Victor's cases here to see if any of them are amenable
to that approach, though.

----------

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


More information about the Python-bugs-list mailing list