summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
Commit message (Collapse)AuthorAgeFilesLines
* [3.9] gh-116773: Fix overlapped memory corruption crash (GH-116774) (GH-117080)jkriegshauser2024-03-271-5/+45
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.9] bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) (GH-32049)Andrew Svetlov2022-03-221-0/+26
| | | | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>. (cherry picked from commit 32e77154ddfc514a3144d5912bffdd957246fd6c) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-47038: Increase a test timeout for slow CI machines (GH-31951)Miss Islington (bot)2022-03-171-1/+1
| | | | | (cherry picked from commit a7c54148322781cb0f332d440a3454d550ef6414) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-47038: Rewrite missed asyncio.wait_for test to use ↵Miss Islington (bot)2022-03-162-26/+24
| | | | | | | IsolatedAnsyncioTestCase (GH-31946) (cherry picked from commit 3dd9bfac04d3dcdbfd3f8011a6c9d4b9ac8c116a) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* [3.9] bpo-47038: Rewrite asyncio.wait_for test to use ↵Andrew Svetlov2022-03-163-340/+270
| | | | | | | IsolatedAsyncioTestCase (GH-31942). (GH-31944) (cherry picked from commit dd0082c627713634c7fd88ad33d18b5cc9f4a7b8) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)Miss Islington (bot)2022-03-151-0/+8
| | | | | (cherry picked from commit 70155412f1543f100d4aa309b8691cbcabd3e0e1) Co-authored-by: Maximilian Hils <git@maximilianhils.com>
* [3.9] bpo-46198: rename duplicate tests and remove unused code (GH-30297) ↵Jelle Zijlstra2022-03-101-1/+0
| | | | | | | (GH-31797) (cherry picked from commit 6c83c8e6b56b57a8a794e7b6c07837be4ce3bb97) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* Inherit asyncio proactor datagram transport from asyncio.DatagramTransport ↵Miss Islington (bot)2022-02-231-0/+1
| | | | | | | (GH-31512) (cherry picked from commit cff4d5c5d29528299ec1ac5b3b3a6f7735577c01) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)Miss Islington (bot)2022-02-221-0/+18
| | | | | | | | Co-authored-by: Thomas Grainger <tagrain@gmail.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com> (cherry picked from commit 8fb94893e4a870ed3533e80c4bc2f1ebf1cfa9e7) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* [3.9] bpo-46672: fix `NameError` in `asyncio.gather` if type check fails ↵Andrew Svetlov2022-02-201-0/+19
| | | | | (GH-31187) (GH-31441) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.9] Fix warning: asyncio.events._event_loop_policy was modified by ↵Andrew Svetlov2022-02-106-3/+27
| | | | | | | test_asyncio (GH-31253). (GH-31256) (cherry picked from commit 012e77eb5c3ba3d411f5967a7f368ebdb42ab88c) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-41682: fixed flaky test ↵Miss Islington (bot)2022-01-251-5/+7
| | | | | | | | | test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30861) (cherry picked from commit 1c705fda8f9902906edd26d46acb0433b0b098e1) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-41682: Skip unstable test_asyncio sendfile test on Windows (GH-30801)Miss Islington (bot)2022-01-231-0/+2
| | | | | (cherry picked from commit 1ded8ed8e817b8f9dae1a0ef92d97983afbc844e) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.9] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) ↵Kumar Aditya2022-01-223-2/+20
| | | | | (GH-30785) Automerge-Triggered-By: GH:asvetlov
* bpo-46425: fix direct invocation of `asyncio` tests (GH-30725)Miss Islington (bot)2022-01-226-2/+25
| | | | | (cherry picked from commit 5a5340044ca98cbe6297668d91bccba04b102923) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.9] bpo-23819: Fix asyncio tests on python optimized mode (GH-30195) ↵Miss Islington (bot)2021-12-263-2/+6
| | | | | | | | (GH-30265) (cherry picked from commit a23ab7b6d8b3ae3a47747c0c4bceb2370cc48dcc) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* Fix test error about deprecation warning (#30205)Andrew Svetlov2021-12-191-1/+2
|
* [3.9] bpo-46129: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase ↵Andrew Svetlov2021-12-191-369/+330
| | | | | | | | (GH-30198) (GH-30204) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>. (cherry picked from commit 9c06fd89514a9a2865e2adcc472095f6949cecb2) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-37658: Actually return result in race condition (GH-29202) (GH-29832)Miss Islington (bot)2021-11-301-30/+8
| | | | | | | (cherry picked from commit 934a82623793e9d52b85f74d5395d65927a52205) Co-authored-by: Sam Bull <aa6bs0@sambull.org> Co-authored-by: Sam Bull <aa6bs0@sambull.org>
* [3.9] Fix typos in the Lib directory (GH-28775) (GH-28803)Christian Clauss2021-10-073-4/+4
| | | | | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> (cherry picked from commit 745c9d9dfc1ad6fdfdf1d07420c6273ff67fa5be) Automerge-Triggered-By: GH:JulienPalard
* [3.9] bpo-45097: Fix deprecation warnings in test_asyncio (GH-28236)Serhiy Storchaka2021-09-081-4/+6
|
* [3.9] bpo-45097: Remove incorrect deprecation warnings in asyncio. (GH-28153)Serhiy Storchaka2021-09-044-169/+137
| | | | | | Deprecation warnings about the loop argument were incorrectly emitted in cases when the loop argument was used inside the asyncio library, not from user code.
* [3.9] bpo-25130: Add calls of gc.collect() in tests to support PyPy ↵Serhiy Storchaka2021-08-291-0/+1
| | | | | | (GH-28005). (GH-28028) (cherry picked from commit 2a8127cafe1d196f858a3ecabf5f1df3eebf9a12)
* [3.9] bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968) ↵Miss Islington (bot)2021-08-265-7/+11
| | | | | | | | (GH-27970) Co-authored-by: Łukasz Langa <lukasz@langa.pl> (cherry picked from commit 7dc505b8655b3e48b93a4274dfd26e5856d9c64f) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)Miss Islington (bot)2021-08-211-1/+2
| | | | | | | The code of the test was never executed because the test function was unintentionally converted to a generator function. (cherry picked from commit 585390fdd8661b4bc08bdfc27551292da9b4b9b8) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.9] bpo-44815: Always show deprecation in asyncio.gather/sleep() (GH-27569)Sam Bull2021-08-181-4/+33
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)Miss Islington (bot)2021-06-221-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. (cherry picked from commit be1cb3214d09d4bf0288bc45f3c1f167f67e4514) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test ↵Miss Islington (bot)2021-06-041-0/+2
| | | | | | | suite (GH-26542) (cherry picked from commit f171877ebe276749f31386baed5841ce37cbee2e) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.9] bpo-43522: Fix SSLContext.hostname_checks_common_name (GH-24899) ↵Christian Heimes2021-04-171-1/+1
| | | | | | | | | | | (GH-25451) 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>. (cherry picked from commit b467d9a24011992242c95d9157d3455f8a84466b) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-41891: ensure asyncio.wait_for waits for task completion (GH-22461) (#23840)Miss Islington (bot)2020-12-181-0/+61
| | | | | | | (cherry picked from commit 17ef4319a34f5a2f95e7823dfb5f5b8cff11882d) Co-authored-by: Richard Kojedzinszky <rkojedzinszky@users.noreply.github.com> Co-authored-by: Richard Kojedzinszky <rkojedzinszky@users.noreply.github.com>
* bpo-42553: Fix test_asyncio.test_call_later() (GH-23627)Miss Islington (bot)2020-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. (cherry picked from commit 7e5e13d113798117d5ef25c5ffdbd0eb39420f98) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-34215: Clarify IncompleteReadError message when "expected" is None ↵Miss Islington (bot)2020-11-281-3/+5
| | | | | | | | | | (GH-21925) (GH-23539) Co-Authored-By: Tyler Bell <mrbell321@gmail.com> (cherry picked from commit 8085f742f4adfbc85f13fc734dfab036aa23acfb) Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-42140: Improve asyncio.wait function (GH-22938)Miss Islington (bot)2020-11-101-0/+24
| | | | | | | | | | | | | GH- 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 (cherry picked from commit 7e5ef0a5713f968f6e942566c78bf57ffbef01de) Co-authored-by: Diogo Dutra <diogodutradamata@gmail.com>
* bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() ↵Miss Islington (bot)2020-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> (cherry picked from commit 42d873c63aa9d160c132be4a34599531574db12c) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-38912: fix close before connect callback in test_asyncio SSL tests ↵Miss Skeleton (bot)2020-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. (cherry picked from commit de73d432bb29f6439f2db16cb991e15e09c70c26) Co-authored-by: Justin Turner Arthur <justinarthur@gmail.com>
* [3.9] bpo-41687: Fix sendfile implementation to work with Solaris (GH-22040) ↵Łukasz Langa2020-09-161-0/+6
| | | | | | | (GH-22273) (cherry picked from commit 8c0be6fd9101746235b63ddfb84106d1e9ca286b) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* bpo-39010: Improve test shutdown (GH-22066) (#22082)Miss Islington (bot)2020-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 (cherry picked from commit be435ae2b064dc64f04475bec632862e1dbf605f) Co-authored-by: Ben Darnell <ben@bendarnell.com> Co-authored-by: Ben Darnell <ben@bendarnell.com>
* bpo-41696: Fix handling of debug mode in asyncio.run (GH-22069) (#22071)Miss Islington (bot)2020-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> (cherry picked from commit 0770ad948cb6d9f7f6c4002efd83e27c27069808) Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
* bpo-39010: Fix errors logged on proactor loop restart (GH-22017) (#22034)Miss Islington (bot)2020-09-032-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. (cherry picked from commit ea5a6363c3f8cc90b7c0cc573922b10f296073b6) Co-authored-by: Ben Darnell <ben@bendarnell.com> Co-authored-by: Ben Darnell <ben@bendarnell.com>
* bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) ↵Miss Islington (bot)2020-08-261-0/+16
| | | | | | | | | | | (GH-21964) 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. (cherry picked from commit a2118a14627256197bddcf4fcecad4c264c1e39d) Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
* bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 ↵Miss Islington (bot)2020-08-261-0/+31
| | | | | | | | | | | (GH-21895) (GH-21963) 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. (cherry picked from commit c517fc712105c8e5930cb42baaebdbe37fc3e15f) Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
* bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() ↵Miss Islington (bot)2020-07-231-0/+19
| | | | | | | (GH-21595) (cherry picked from commit 0dd98c2d00a75efbec19c2ed942923981bc06683) Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
* bpo-40967: Remove deprecated asyncio.Task.current_task() and ↵Miss Islington (bot)2020-07-021-47/+1
| | | | | | | asyncio.Task.all_tasks() (GH-20874) (cherry picked from commit 004e64e8059fe68a72890314673282f2e60d5ce1) Co-authored-by: Rémi Lapeyre <remi.lapeyre@lenstra.fr>
* bpo-38377: Add support.skip_if_broken_multiprocessing_synchronize() ↵Victor Stinner2020-06-181-2/+2
| | | | | | | | | | (GH-20944) (GH-20962) 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. (cherry picked from commit ddbeb2f3e02a510c5784ffd74c5e09e8c70b5881)
* bpo-30064: Fix slow asyncio sock test (GH-20868)Miss Islington (bot)2020-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.pyGH-L256-L257 (cherry picked from commit 8f04a84755babe516ebb5304904ea7c15b865c80) Co-authored-by: Fantix King <fantix.king@gmail.com>
* bpo-30064: Properly skip unstable loop.sock_connect() racing test (GH-20494)Miss Islington (bot)2020-05-281-20/+26
| | | | | (cherry picked from commit dc4eee9e266267498a6b783a0abccc23c06f2b87) Co-authored-by: Fantix King <fantix.king@gmail.com>
* bpo-30064: Fix unstable asyncio "racing" socket tests (GH-20485)Miss Islington (bot)2020-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). (cherry picked from commit 84ee7e1573d166fe7a9be676813e12523b62ab24) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-30064: Fix asyncio loop.sock_* race condition issue (GH-20369)Miss Islington (bot)2020-05-271-0/+131
| | | | | (cherry picked from commit 210a137396979d747c2602eeef46c34fc4955448) Co-authored-by: Fantix King <fantix.king@gmail.com>
* bpo-40696: Fix a hang that can arise after gen.throw() (GH-20287)Miss Islington (bot)2020-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. (cherry picked from commit 7c30d12bd5359b0f66c4fbc98aa055398bcc8a7e) Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
* bpo-32309: Add support for contextvars in asyncio.to_thread() (GH-20278)Miss Islington (bot)2020-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/20143GH-discussion_r427808225) in GH-20143 for context. Automerge-Triggered-By: @aeros (cherry picked from commit 0f56263e62ba91d0baae40fb98947a3a98034a73) Co-authored-by: Kyle Stanley <aeros167@gmail.com>