summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-107895: Fix test_asyncio.test_runners when run it in CPython's ↵Miss Islington (bot)2023-08-211-1/+4
| | | | | | | | "development mode" (GH-108168) (#108196) gh-107895: Fix test_asyncio.test_runners when run it in CPython's "development mode" (GH-108168) (cherry picked from commit 014a5b71e7538926ae1c03c8c5ea13c96e741be3) Co-authored-by: Joon Hwan 김준환 <xncbf12@gmail.com>
* [3.12] gh-105987: Fix reference counting issue in `_asyncio._swap_cur… ↵Kumar Aditya2023-06-261-1/+18
| | | | | | | | (#106099) [3.12] gh-105987: Fix reference counting issue in `_asyncio._swap_current_task` (GH-105989). (cherry picked from commit d2cbb6e918d9ea39f0dd44acb53270f2dac07454) Co-authored-by: chgnrdv <52372310+chgnrdv@users.noreply.github.com>
* gh-97696: asyncio eager tasks factory (#102853)Itamar Ostricher2023-05-011-0/+344
| | | | Co-authored-by: Jacob Bower <jbower@meta.com> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* gh-103793: Defer formatting task name (#103767)Itamar Ostricher2023-04-291-0/+12
| | | | | | | | | | | | | The default task name is "Task-<counter>" (if no name is passed in during Task creation). This is initialized in `Task.__init__` (C impl) using string formatting, which can be quite slow. Actually using the task name in real world code is not very common, so this is wasted init. Let's defer this string formatting to the first time the name is read (in `get_name` impl), so we don't need to pay the string formatting cost if the task name is never read. We don't change the order in which tasks are assigned numbers (if they are) -- the number is set on task creation, as a PyLong instead of a formatted string. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-83925: Make asyncio.subprocess communicate similar to non-asyncio (#18650)Marek Marczykowski-Górecki2023-04-281-0/+18
| | | | | | | subprocess's communicate(None) closes stdin of the child process, after sending no (extra) data. Make asyncio variant do the same. This fixes issues with processes that waits for EOF on stdin before continuing.
* gh-103607: Fix `pause_reading` to work when called from `connection_made` in ↵Itayazolay2023-04-272-0/+29
| | | | | `asyncio`. (#17425) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-103780: Use patch instead of mock in asyncio unix events test (#103782)Itamar Ostricher2023-04-241-5/+4
|
* gh-103462: Ensure SelectorSocketTransport.writelines registers a writer when ↵Ali-Akber Saifee2023-04-131-0/+42
| | | | data is still pending (#103463)
* gh-102799: use sys.exception() instead of sys.exc_info() in tests (#103293)Irit Katriel2023-04-062-2/+2
|
* gh-102780: Fix uncancel() call in asyncio timeouts (#102815)Kristján Valur Jónsson2023-03-221-0/+30
| | | | | | | Also use `raise TimeOut from <CancelledError instance>` so that the CancelledError is set in the `__cause__` field rather than in the `__context__` field. Co-authored-by: Guido van Rossum <gvanrossum@gmail.com> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800)Irit Katriel2023-03-181-2/+2
|
* GH-78530: add support for generators in `asyncio.wait` (#102761)Kumar Aditya2023-03-171-0/+16
|
* GH-102748: remove legacy support for generator based coroutines from ↵Kumar Aditya2023-03-161-0/+6
| | | | | `asyncio.iscoroutine` (#102749) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* GH-100112: avoid using iterable coroutines in asyncio internally (#100128)Kumar Aditya2023-03-161-0/+15
|
* gh-102515: Remove unused imports in the `Lib/` directory (#102516)Alex Waygood2023-03-082-2/+0
|
* GH-97546: fix flaky asyncio `test_wait_for_race_condition` test (#102421)Kumar Aditya2023-03-051-1/+1
|
* GH-96764: rewrite `asyncio.wait_for` to use `asyncio.timeout` (#98518)Kumar Aditya2023-02-162-31/+103
| | | Changes `asyncio.wait_for` to use `asyncio.timeout` as its underlying implementation.
* GH-84559: Deprecate fork being the multiprocessing default. (#100618)Gregory P. Smith2023-02-021-1/+8
| | | | | | | | This starts the process. Users who don't specify their own start method and use the default on platforms where it is 'fork' will see a DeprecationWarning upon multiprocessing.Pool() construction or upon multiprocessing.Process.start() or concurrent.futures.ProcessPool use. See the related issue and documentation within this change for details.
* gh-101326: Fix regression when passing None to FutureIter.throw (#101327)Shantanu2023-01-251-0/+2
|
* GH-100573: Fix server hang caused by os.stat() on named pipe (Windows) (#100959)Guido van Rossum2023-01-131-0/+40
|
* gh-100160: Restore and deprecate implicit creation of an event loop (GH-100410)Serhiy Storchaka2023-01-132-6/+37
| | | | | | | | | | Partially revert changes made in GH-93453. asyncio.DefaultEventLoopPolicy.get_event_loop() now emits a DeprecationWarning and creates and sets a new event loop instead of raising a RuntimeError if there is no current event loop set. Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* GH-86508: skip binding to local addresses of different family in ↵Kumar Aditya2023-01-041-0/+41
| | | | `asyncio.open_connection` (#100615)
* GH-100192: fix `asyncio` subprocess tests to pass env vars to subprocess ↵Kumar Aditya2022-12-281-2/+4
| | | | (#100569)
* add tests for `asyncio` transport sockets (#100263)Kumar Aditya2022-12-281-0/+23
|
* GH-100192: add more `asyncio` subprocess tests (#100194)Kumar Aditya2022-12-281-0/+82
|
* GH-91166: Implement zero copy writes for `SelectorSocketTransport` in ↵Kumar Aditya2022-12-241-18/+99
| | | | | asyncio (#31871) Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* gh-100344: Add C implementation for `asyncio.current_task` (#100345)Itamar Ostricher2022-12-221-7/+14
| | | Co-authored-by: pranavtbhat
* GH-100133: fix `asyncio` subprocess losing `stderr` and `stdout` output ↵Kumar Aditya2022-12-211-0/+17
| | | | (#100154)
* gh-99941: Ensure that asyncio.Protocol.data_received receives immutable ↵DarioDaF2022-12-101-1/+4
| | | | bytes (#100053)
* Fix potential flakiness in `test_run_until_complete_baseexception` (#100148)Fantix King2022-12-101-1/+1
|
* GH-100113: remove remaining `yield from` usage from `asyncio` tests (#100114)Kumar Aditya2022-12-091-2/+2
|
* Fix `test_run_until_complete_baseexception` test to check for ↵Fantix King2022-12-081-8/+3
| | | | `KeyboardInterrupt` in asyncio (#24477)
* gh-93453: No longer create an event loop in get_event_loop() (#98440)Serhiy Storchaka2022-12-066-130/+62
| | | | | | | | | | | | | | | asyncio.get_event_loop() now always return either running event loop or the result of get_event_loop_policy().get_event_loop() call. The latter should now raise an RuntimeError if no current event loop was set instead of creating and setting a new event loop. It affects also a number of asyncio functions and constructors which call get_event_loop() implicitly: ensure_future(), shield(), gather(), etc. DeprecationWarning is no longer emitted if there is no running event loop but the current event loop was set. Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-60203: Always pass True/False as boolean arguments in tests (GH-99983)Serhiy Storchaka2022-12-041-1/+1
| | | Unless we explicitly test non-bool values.
* GH-66285: remove redundant `time.sleep` from `test_fork_signal_handling` ↵Kumar Aditya2022-12-031-1/+0
| | | | (GH-99963)
* GH-66285: fix forking in asyncio (#99769)Kumar Aditya2022-11-271-0/+98
| | | Closes #66285
* GH-66285: Revert "fix forking in asyncio" (#99756)Kumar Aditya2022-11-241-99/+0
|
* GH-66285: skip asyncio fork tests for platforms without md5 hash (#99745)Kumar Aditya2022-11-241-0/+4
| | | Such buildbots (at the time of writing, only "AMD64 RHEL8 FIPS Only Blake2 Builtin Hash 3.x") cannot use multiprocessing with a fork server, so just skip the test there.
* GH-79033: Fix asyncio.Server.wait_closed() (#98582)Guido van Rossum2022-11-242-1/+28
| | | | | | | | | | | It was a no-op when used as recommended (after close()). I had to debug one test (test__sock_sendfile_native_failure) -- the cleanup sequence for the test fixture was botched. Hopefully that's not a portend of problems in user code -- this has never worked so people may well be doing this wrong. :-( Co-authored-by: kumar aditya
* GH-66285: fix forking in `asyncio` (#99539)Kumar Aditya2022-11-241-0/+95
| | | `asyncio` now does not shares event loop and signal wakeupfd in forked processes.
* GH-98219: reduce sleep time in `asyncio` subprocess test (#99464)Kumar Aditya2022-11-141-1/+1
|
* GH-99388: add `loop_factory` parameter to `asyncio.run` (#99462)Kumar Aditya2022-11-141-0/+10
|
* gh-99357: Close the event loop when it is no longer used in ↵Xiao Chen2022-11-121-21/+24
| | | | test_uncancel_structured_blocks (#99414)
* GH-94597: add deprecation warnings for subclassing `AbstractChildWatcher` ↵Kumar Aditya2022-11-121-1/+8
| | | | (#99386)
* gh-98793: Fix typecheck in `overlapped.c` (#98835)Charlie Zhao2022-10-301-0/+11
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* GH-90352: fix _SelectorDatagramTransport to inherit from DatagramTransport ↵Kumar Aditya2022-10-291-0/+4
| | | | (#98844)
* gh-98703: Add tests for closing `_ProactorSocketTransport` with proactor ↵Kumar Aditya2022-10-271-0/+21
| | | | event loop (GH-98730)
* GH-89237: fix hang in proactor `subprocess.wait_closed()` (#98572)Kumar Aditya2022-10-241-1/+6
|
* GH-98407: fix `test_kill_issue43884` to not leak child processes (#98491)Kumar Aditya2022-10-241-1/+4
|
* gh-98174: Handle EPROTOTYPE under macOS in ↵fancidev2022-10-171-2/+12
| | | | | test_sendfile_fallback_close_peer_in_the_middle_of_receiving (#98316) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>