summaryrefslogtreecommitdiff
path: root/Lib/test/test_asyncio
Commit message (Collapse)AuthorAgeFilesLines
* 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-282-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-201-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-181-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
* bpo-39148: fixup to account for IPV6_ENABLED being moved (GH-20170)Nathaniel J. Smith2020-05-181-1/+1
|
* bpo-39148: enable ipv6 for datagrams in Proactor (GH-19121)Kjell Braden2020-05-171-3/+12
| | | | | | Ifdef is not necessary, as AF_INET6 is supported from Windows Vista, and other code in overlapped.c uses AF_INET6 and is not ifdef'd. Change the raised exception so users are not fooled to think it comes from Windows API. Automerge-Triggered-By: @njsmith
* bpo-31033: Improve the traceback for cancelled asyncio tasks (GH-19951)Chris Jerdonek2020-05-171-22/+114
| | | | | When an asyncio.Task is cancelled, the exception traceback now starts with where the task was first interrupted. Previously, the traceback only had "depth one."
* bpo-31033: Add a msg argument to Future.cancel() and Task.cancel() (GH-19979)Chris Jerdonek2020-05-152-25/+162
|
* bpo-40607: Reraise exception during task cancelation in asyncio.wait_for() ↵romasku2020-05-151-4/+51
| | | | | | | | | | | | | | | (GH-20054) Currently, if asyncio.wait_for() timeout expires, it cancels inner future and then always raises TimeoutError. In case those future is task, it can handle cancelation mannually, and those process can lead to some other exception. Current implementation silently loses thoses exception. To resolve this, wait_for will check was the cancelation successfull or not. In case there was exception, wait_for will reraise it. Co-authored-by: Roman Skurikhin <roman.skurikhin@cruxlab.com>
* bpo-29587: Make gen.throw() chain exceptions with yield from (GH-19858)Chris Jerdonek2020-05-131-0/+27
| | | | | | | | | | | | The previous commits on bpo-29587 got exception chaining working with gen.throw() in the `yield` case. This patch also gets the `yield from` case working. As a consequence, implicit exception chaining now also works in the asyncio scenario of awaiting on a task when an exception is already active. Tests are included for both the asyncio case and the pure generator-only case.
* bpo-40443: Remove unused imports in tests (GH-19804)Victor Stinner2020-04-303-3/+0
|
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-258-37/+44
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-40115: Fix refleak in test_asyncio.test_run_in_executor_cancel() (GH-19282)Kyle Stanley2020-04-021-0/+2
| | | Call explicitly self.loop.shutdown_default_executor().
* bpo-39794: Add --without-decimal-contextvar (#18702)Stefan Krah2020-02-291-0/+1
|
* Suppress the hang (#18457)Andrew Svetlov2020-02-271-2/+9
|
* bpo-34793: Drop old-style context managers in asyncio.locks (GH-17533)Andrew Svetlov2020-02-012-138/+40
|
* bpo-39191: Fix RuntimeWarning in asyncio test (GH-17863)Andrew Svetlov2020-01-071-2/+6
| | | https://bugs.python.org/issue39191
* bpo-34790: Implement deprecation of passing coroutines to asyncio.wait() ↵Kyle Stanley2019-12-301-5/+19
| | | | (GH-16977)
* Fix warnings in test_asyncio.test_base_events (#17577)Kyle Stanley2019-12-121-3/+4
| | | Co-authored-by: tirkarthi
* bpo-38614: Use test.support.SHORT_TIMEOUT constant (GH-17566)Victor Stinner2019-12-113-11/+16
| | | | | | | | | | | | | | | Replace hardcoded timeout constants in tests with SHORT_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once. SHORT_TIMEOUT is 30 seconds by default, but it can be longer depending on --timeout command line option. The change makes almost all timeouts longer, except test_reap_children() of test_support which is made 2x shorter: SHORT_TIMEOUT should be enough. If this test starts to fail, LONG_TIMEOUT should be used instead. Uniformize also "from test import support" import in some test files.
* bpo-38614: Use test.support.LONG_TIMEOUT constant (GH-17562)Victor Stinner2019-12-101-1/+2
| | | | | | | | Replace hardcoded timeout constants in tests with LONG_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once. LONG_TIMEOUT is 5 minutes by default, but it can be longer depending on --timeout command line option.
* bpo-38614: Use default join_thread() timeout in tests (GH-17559)Victor Stinner2019-12-101-1/+1
| | | | | Tests no longer pass a timeout value to join_thread() of test.support: use the default join_thread() timeout instead (SHORT_TIMEOUT constant of test.support).
* bpo-38614: Use test.support.LOOPBACK_TIMEOUT constant (GH-17554)Victor Stinner2019-12-104-6/+8
| | | | | Replace hardcoded timeout constants in tests with LOOPBACK_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once.
* bpo-37228: Fix loop.create_datagram_endpoint()'s usage of SO_REUSEADDR (#17311)Kyle Stanley2019-12-091-17/+24
|
* bpo-38529: Fix asyncio stream warning (GH-17474)Andrew Svetlov2019-12-071-53/+0
|
* bpo-38841: Skip asyncio test_create_datagram_endpoint_existing_sock_unix ↵xdegaye2019-11-201-1/+1
| | | | | | | | | | | | | (GH-17294) on platforms lacking a functional bind() for named unix domain sockets https://bugs.python.org/issue38841 Automerge-Triggered-By: @asvetlov
* closes bpo-38692: Add a pidfd child process watcher to asyncio. (GH-17069)Benjamin Peterson2019-11-131-0/+18
|
* bpo-38785: Prevent asyncio from crashing (GH-17144)Andrew Svetlov2019-11-131-0/+39
| | | | | | | if parent `__init__` is not called from a constructor of object derived from `asyncio.Future` https://bugs.python.org/issue38785
* bpo-38614: Increase asyncio test_communicate() timeout (GH-16995)Victor Stinner2019-10-301-1/+1
| | | | Fix test_communicate() of test_asyncio.test_subprocess: use support.LONG_TIMEOUT (5 minutes), instead of 1 minute.
* bpo-34679: ProactorEventLoop only uses set_wakeup_fd() in main thread (GH-16901)Victor Stinner2019-10-231-0/+2
| | | | bpo-34679, bpo-38563: asyncio.ProactorEventLoop.close() now only calls signal.set_wakeup_fd() in the main thread.
* bpo-35998: Fix test_asyncio.test_start_tls_server_1() (GH-16815)Victor Stinner2019-10-161-14/+10
| | | | | | | | | | main() is now responsible to send the ANSWER, rather than ServerProto. main() now waits until it got the HELLO before sending the ANSWER over the new transport. Previously, there was a race condition between main() replacing the protocol and the protocol sending the ANSWER once it gets the HELLO. TLSv1.3 was disabled for the test: reenable it.
* bpo-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)Yury Selivanov2019-09-295-979/+192
| | | See https://bugs.python.org/issue38242 for more details
* bpo-38019: correctly handle pause/resume reading of closed asyncio unix pipe ↵Andrew Svetlov2019-09-291-0/+27
| | | | (GH-16472)
* bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)Yury Selivanov2019-09-251-0/+4
|
* bpo-33694: Remove test_asyncio ProactorDatagramTransportTests (GH-16288)Victor Stinner2019-09-201-253/+0
| | | | ProactorDatagramTransportTests tests are too close to the implementation.
* bpo-34037: test_asyncio uses shutdown_default_executor() (GH-16284)Victor Stinner2019-09-193-3/+13
|
* bpo-37199: Replace the early returns added in c2cda63. (GH-14535)Zackery Spytz2019-09-131-37/+34
|
* bpo-38148: Add slots to asyncio transports (GH-16077)Andrew Svetlov2019-09-131-4/+9
| | | | | | | | * bpo-38148: Add slots to asyncio transports * Update Misc/NEWS.d/next/Library/2019-09-13-08-55-43.bpo-38148.Lnww6D.rst Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
* bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)Andrew Svetlov2019-09-123-89/+117
|
* bpo-38107: Replace direct future and task contructor calls with factories in ↵Andrew Svetlov2019-09-1113-159/+156
| | | | asyncio tests (GH-15928)
* bpo-36373: Fix deprecation warnings (GH-15889)Andrew Svetlov2019-09-112-6/+4
| | | https://bugs.python.org/issue36373
* bpo-38066: Hide internal Stream methods (GH-15762)Andrew Svetlov2019-09-102-81/+105
| | | | | | feed_eof(), feed_data(), set_exception(), and set_transport() are prefixed with underscore now. https://bugs.python.org/issue38066
* bpo-36373: Deprecate explicit loop parameter in all public asyncio APIs ↵Emmanuel Arias2019-09-105-253/+372
| | | | | | | | | | | | | | | [locks] (GH-13920) This PR deprecate explicit loop parameters in all public asyncio APIs This issues is split to be easier to review. Third step: locks.py https://bugs.python.org/issue36373
* bpo-15999: Always pass bool instead of int to socket.setblocking(). (GH-15621)Serhiy Storchaka2019-09-011-1/+1
|
* bpo-34679: Restore instantiation Windows IOCP event loop from non-main ↵Andrew Svetlov2019-08-261-0/+19
| | | | | | | | thread (#15492) * Restore running proactor event loop from non-main thread Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
* bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)Serhiy Storchaka2019-08-081-0/+23
| | | | They now return NotImplemented for unsupported type of the other operand.
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-017-12/+0
|