summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45129 Remove deprecated reuse_address (GH-28207)Hugo van Kemenade2021-09-081-26/+0
| | | | | | | | Due to significant security concerns, the reuse_address parameter of asyncio.loop.create_datagram_endpoint, deprecated in Python 3.9, is now removed. This is because of the behavior of the socket option SO_REUSEADDR in UDP. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005)Serhiy Storchaka2021-08-291-0/+1
|
* bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)Serhiy Storchaka2021-08-264-7/+10
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)Serhiy Storchaka2021-08-211-1/+2
| | | | The code of the test was never executed because the test function was unintentionally converted to a generator function.
* bpo-43234: Prohibit non-ThreadPoolExecutor in loop.set_default_executor ↵Illia Volochii2021-07-011-4/+4
| | | | (GH-24540)
* bpo-43216: Remove @asyncio.coroutine (GH-26369)Illia Volochii2021-07-015-538/+64
| | | | | | | | | Remove the @asyncio.coroutine decorator enabling legacy generator-based coroutines to be compatible with async/await code; remove asyncio.coroutines.CoroWrapper used for wrapping legacy coroutine objects in the debug mode. The decorator has been deprecated since Python 3.8 and the removal was initially scheduled for Python 3.10.
* bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)Victor Stinner2021-06-211-1/+2
| | | | | | | | Fix asyncio test_popen() of test_windows_utils by using a longer timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT timeout rather than a hardcoded timeout of 10 seconds: it's 30 seconds by default, but it is made longer on slow buildbots. WaitForMultipleObjects() timeout argument is in milliseconds.
* bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test ↵Pablo Galindo2021-06-041-0/+2
| | | | suite (GH-26542)
* bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)Pablo Galindo2021-05-034-1757/+60
| | | | This reverts commit 5fb06edbbb769561e245d0fe13002bab50e2ae60 and all subsequent dependent commits.
* Increase test timeout (GH-25842)Andrew Svetlov2021-05-031-3/+3
|
* bpo-44011: Fix asyncio tests without ssl module (GH-25840)Christian Heimes2021-05-031-2/+7
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-44011: New asyncio ssl implementation (#17975)Andrew Svetlov2021-05-024-60/+1752
|
* bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() ↵Serhiy Storchaka2021-04-255-152/+405
| | | | | | (GH-23554) asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop. In future releases it will became an alias of asyncio.get_running_loop().
* bpo-43880: Show DeprecationWarnings for deprecated ssl module features ↵Christian Heimes2021-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-25455) * ssl.OP_NO_SSLv2 * ssl.OP_NO_SSLv3 * ssl.OP_NO_TLSv1 * ssl.OP_NO_TLSv1_1 * ssl.OP_NO_TLSv1_2 * ssl.OP_NO_TLSv1_3 * ssl.PROTOCOL_SSLv2 * ssl.PROTOCOL_SSLv3 * ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS) * ssl.PROTOCOL_TLS * ssl.PROTOCOL_TLSv1 * ssl.PROTOCOL_TLSv1_1 * ssl.PROTOCOL_TLSv1_2 * ssl.TLSVersion.SSLv3 * ssl.TLSVersion.TLSv1 * ssl.TLSVersion.TLSv1_1 * ssl.wrap_socket() * ssl.RAND_pseudo_bytes() * ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1) * ssl.SSLContext() without a protocol argument * ssl.match_hostname() * hashlib.pbkdf2_hmac() (pure Python implementation, fast OpenSSL function will stay) Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43522: Fix SSLContext.hostname_checks_common_name (GH-24899)Christian Heimes2021-04-171-1/+1
| | | | | | Fix problem with ssl.SSLContext.hostname_checks_common_name. OpenSSL does not copy hostflags from *struct SSL_CTX* to *struct SSL*. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361)Christian Heimes2021-04-121-1/+1
|
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)Inada Naoki2021-04-042-2/+2
| | | | | | | | | | | | | | | | | | | * test_asyncio * test_bz2 * test_math * test_cmath * test_cmd_line * test_cmd_line_script * test_compile * test_contextlib * test_profile * ctypes/test/test_find * test_multiprocessing * test_configparser * test_csv * test_dbm_dumb * test_decimal * test_difflib * os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
* bpo-41891: ensure asyncio.wait_for waits for task completion (#22461)Richard Kojedzinszky2020-12-181-0/+61
|
* bpo-31904: Skip some asyncio tests on VxWorks (#23815)pxinwr2020-12-172-1/+10
|
* bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)Victor Stinner2020-12-161-196/+65
| | | | | test_unix_events.py no longer checks if waitstatus_to_exitcode() mock has been called or not to make the test more functional, rather than checking the exact implementation.
* bpo-42553: Fix test_asyncio.test_call_later() (GH-23627)Victor Stinner2020-12-031-3/+0
| | | | | Fix test_asyncio.test_call_later() race condition: don't measure asyncio performance in the call_later() unit test. The test failed randomly on the CI.
* bpo-34215: Clarify IncompleteReadError message when "expected" is None ↵Zackery Spytz2020-11-281-3/+5
| | | | | (GH-21925) Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
* bpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess ↵Yurii Karabas2020-11-283-84/+39
| | | | (GH-23521)
* bpo-42392: Remove loop parameter from asyncio.streams (GH-23517)Yurii Karabas2020-11-264-81/+45
|
* bpo-42392: Improve removal of *loop* parameter in asyncio primitives (GH-23499)Yurii Karabas2020-11-252-21/+17
| | | | | | | | | | * Update code after merge review from 1st1 * Use a sentinel approach for loop parameter Remove unnecessary _get_running_loop patching * Use more clear function name (_verify_parameter_is_marker -> _verify_no_loop) * Add init method to _LoopBoundMixin to check that loop param wasn't used
* bpo-42392: Remove loop parameter form asyncio locks and Queue (#23420)Yurii Karabas2020-11-245-384/+257
| | | Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)Christian Heimes2020-11-201-1/+1
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-42140: Improve asyncio.wait function (GH-22938)Diogo Dutra2020-11-101-0/+24
| | | | | | | | | | # Improve asyncio.wait function The original code creates the futures set two times. We can create this set before, avoiding the second creation. This new behaviour [breaks the aiokafka library](https://github.com/aio-libs/aiokafka/pull/672), because it gives an iterator to that function, so the second iteration become empty. Automerge-Triggered-By: GH:1st1
* bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() ↵Andrew Svetlov2020-11-101-0/+18
| | | | | | | | (GH-23020) The overflow occurs under some circumstances when a task or future recursively returns itself. Co-authored-by: Kyle Stanley <aeros167@gmail.com>
* bpo-38912: fix close before connect callback in test_asyncio SSL tests ↵Justin Turner Arthur2020-10-201-0/+2
| | | | | (GH-22691) Reduces the rate at which the ENV CHANGED failure occurs in test_asyncio SSL tests (due to unclosed transport), but does not 100% resolve it.
* bpo-41687: Fix sendfile implementation to work with Solaris (#22040)Jakub Kulík2020-09-051-0/+6
|
* bpo-39010: Improve test shutdown (#22066)Ben Darnell2020-09-031-3/+11
| | | | | | | Simply closing the event loop isn't enough to avoid warnings. If we don't also shut down the event loop's default executor, it sometimes logs a "dangling thread" warning. Follow-up to GH-22017
* bpo-41696: Fix handling of debug mode in asyncio.run (#22069)Shantanu2020-09-031-0/+3
| | | | | | | | | | | * bpo-41696: Fix handling of debug mode in asyncio.run This allows PYTHONASYNCIODEBUG or -X dev to enable asyncio debug mode when using asyncio.run * 📜🤖 Added by blurb_it. Co-authored-by: hauntsaninja <> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39010: Fix errors logged on proactor loop restart (#22017)Ben Darnell2020-08-312-0/+21
| | | | | | Stopping and restarting a proactor event loop on windows can lead to spurious errors logged (ConnectionResetError while reading from the self pipe). This fixes the issue by ensuring that we don't attempt to start multiple copies of the self-pipe reading loop.
* bpo-37658: Fix asyncio.wait_for() to respect waited task status (#21894)Elvis Pranskevichus2020-08-261-0/+16
| | | | | | Currently, if `asyncio.wait_for()` itself is cancelled it will always raise `CancelledError` regardless if the underlying task is still running. This is similar to a race with the timeout, which is handled already.
* bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (#21895)Elvis Pranskevichus2020-08-261-0/+31
| | | | | | When I was fixing bpo-32751 back in GH-7216 I missed the case when *timeout* is zero or negative. This takes care of that. Props to @aaliddell for noticing the inconsistency.
* bpo-40275: Use new test.support helper submodules in tests (GH-21764)Hai Shi2020-08-071-4/+4
|
* bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() (#21595)Alex Grönholm2020-07-231-0/+19
|
* bpo-41273: asyncio's proactor read transport's better performance by using ↵Tony Solomonik2020-07-141-27/+43
| | | | | | | | | | | | | | | recv_into instead of recv (#21442) * bpo-41273: Proactor transport read loop to use recv_into By using recv_into instead of recv we do not allocate a new buffer each time _loop_reading calls recv. This betters performance for any stream using proactor (basically any asyncio stream on windows). * bpo-41273: Double proactor read transport buffer size By doubling the read buffer size we get better performance.
* bpo-40967: Remove deprecated asyncio.Task.current_task() and ↵Rémi Lapeyre2020-07-021-47/+1
| | | | asyncio.Task.all_tasks() (GH-20874)
* bpo-40275: Use new test.support helper submodules in tests (GH-20824)Hai Shi2020-06-255-16/+21
|
* bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() (GH-20944)Victor Stinner2020-06-181-2/+2
| | | | | | On Linux, skip tests using multiprocessing if the current user cannot create a file in /dev/shm/ directory. Add the skip_if_broken_multiprocessing_synchronize() function to the test.support module.
* bpo-30064: Fix slow asyncio sock test (GH-20868)Fantix King2020-06-141-14/+20
| | | | | | | | | | | | | Using a log2n way to fill a much smaller buffer, and receiving in a cleaner way with EOF. The failing test was reproducible using the following command thanks to @aeros : ```bash ./python -m test test_asyncio.test_sock_lowlevel --match test_sock_client_racing -j100 -F -v ``` According to test results, we may still need to bump the timeout: https://github.com/python/cpython/blob/5aad027db9618f22f6fa2274e05dd50f928d2ed7/Lib/test/test_asyncio/test_sock_lowlevel.py#L256-L257
* bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)Fantix King2020-05-281-20/+26
|
* bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)Victor Stinner2020-05-281-0/+4
| | | | | Skip new "racing" socket tests which fail randomly until someone fix them, to ease analysis of buildbot failures (skip tests which are known to be broken/unstable).
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-272-3/+5
|
* bpo-30064: Fix asyncio loop.sock_* race condition issue (#20369)Fantix King2020-05-271-0/+131
|
* bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287)Chris Jerdonek2020-05-221-3/+36
| | | | | | | | This updates _PyErr_ChainStackItem() to use _PyErr_SetObject() instead of _PyErr_ChainExceptions(). This prevents a hang in certain circumstances because _PyErr_SetObject() performs checks to prevent cycles in the exception context chain while _PyErr_ChainExceptions() doesn't.
* bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)Kyle Stanley2020-05-211-0/+14
| | | | | Allows contextvars from the main thread to be accessed in the separate thread used in `asyncio.to_thread()`. See the [discussion](https://github.com/python/cpython/pull/20143#discussion_r427808225) in GH-20143 for context. Automerge-Triggered-By: @aeros
* bpo-32309: Implement asyncio.to_thread() (GH-20143)Kyle Stanley2020-05-191-0/+79
| | | | | Implements `asyncio.to_thread`, a coroutine for asynchronously running IO-bound functions in a separate thread without blocking the event loop. See the discussion starting from [here](https://github.com/python/cpython/pull/18410#issuecomment-628930973) in GH-18410 for context. Automerge-Triggered-By: @aeros