You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fixed sporadic problems with timeouts on Win Py2.6.
Timeout tests started to fail sporadically on Windows with Python 2.6
after recent refactoring of keyword execution logic. Based on git
bisect the "bad commit" was 08390eb.
The actual problem turned out to be in the code related to
asynchronously raising exception in the runner thread to signal
timeout. In some cases the exception was raised so that it occurred
during the code that was trying to cancel it. Most likely the old
keyword execution code catched the resulting TimeoutError but that
didn't anymore happen after the refactoring. Not sure why that problem
only manifested itself with Python 2.6, though.
The fix has two parts:
- Check has timeout occurred inside try/finally and wait for it to be
actually raised. This ensures it won't happen inside the finally block.
- Add new `_finished` flag to signal execution has finished and timeout
should not be raised. Also use locks to avoid race conditions when
setting `_finished` and `_timeout_occurred`.
Interestingly the problem seems to vanish with just the first
fix. Looking at the code, the problem could occur also then, so it is safer
to keep both parts.
0 commit comments