[issue38564] test_asyncio: test_run_coroutine_threadsafe_with_timeout() has a race condition

Kyle Stanley report at bugs.python.org
Fri Oct 25 08:53:20 EDT 2019


Kyle Stanley <aeros167 at gmail.com> added the comment:

> IHMO a test must not depend on time.

I would agree, the tests should optimally not depend on time. My above comment was primarily to confirm that the failure was able to be consistently reproduced, along with the minimum conditions to do so.

Yury had been the one to change it to "asyncio.sleep(0.05)" from the previous "asyncio.sleep(1)" in the following commit: https://github.com/python/cpython/commit/abe9625eeb71e40f042ccfccfe6a4489a6dcdf35 (Nov 13, 2015).

Perhaps he might have some insight or ideas as to how we could improve the test to use a more reliable means of synchronization that has been implemented since that change was made. I'll add him to the nosy list.

----------
nosy: +yselivanov

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38564>
_______________________________________


More information about the Python-bugs-list mailing list