Author aeros
Recipients aeros, vstinner
Date 2019-10-25.11:53:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I can confirm Victor's method of reproducing the failure consistently, by using asyncio.sleep(1e-9) within `RunCoroutineThreadsafeTests.add()` instead of the current asyncio.sleep(0.05).

I also experimented with adjusting the sleep time, to figure out the "breaking point" where I could no longer run `./python -m test test_asyncio -m test_run_coroutine_threadsafe_with_timeout -v -F` without failures (within ~10,000 tests). From my results, the lowest reliable value was 0.001. At 1e-4, I was able to consistently reproduce the failure reported above:

FAIL: test_run_coroutine_threadsafe_with_timeout (test.test_asyncio.test_tasks.RunCoroutineThreadsafeTests)
Test coroutine submission from a thread to an event loop
Traceback (most recent call last):
  File "/home/aeros/repos/cpython/Lib/test/test_asyncio/", line 3210, in test_run_coroutine_threadsafe_with_timeout
AssertionError: TimeoutError not raised

The failure becomes increasingly consistent with lowered time as expected, but at 1e-5 I was able to repeatedly reproduce the failure within 10 iterations of the test. At 1e-4 it took around 3000 iterations before failing (across multiple runs).
Date User Action Args
2019-10-25 11:53:45aerossetrecipients: + aeros, vstinner
2019-10-25 11:53:45aerossetmessageid: <>
2019-10-25 11:53:45aeroslinkissue38564 messages
2019-10-25 11:53:45aeroscreate