summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio
Commit message (Collapse)AuthorAgeFilesLines
...
* Use support.sleeping_retry() and support.busy_retry() (#93848)Victor Stinner2022-06-151-6/+5
| | | | | | * Replace time.sleep(0.010) with sleeping_retry() to use an exponential sleep. * support.wait_process(): reuse sleeping_retry(). * _test_eintr: remove unused variables.
* gh-84623: Remove unused imports in tests (#93772)Victor Stinner2022-06-135-8/+1
|
* gh-93247: Fix assert function in asyncio locks test (#93248)Cyker Way2022-06-061-1/+1
|
* gh-93124: Fix typos in comments (GH-93125)Akuli2022-05-252-4/+4
| | | | | Fixes #93124 Automerge-Triggered-By: GH:rhettinger
* gh-90978: asyncio TestSSL uses SHORT_TIMEOUT (#92642)Victor Stinner2022-05-111-10/+13
| | | | TestSSL of asyncio now uses support.SHORT_TIMEOUT rather than hardcoded timeouts like 5, 10 or 40 seconds.
* gh-90978: test_ssl of test_asyncio uses LONG_TIMEOUT (#92402)Victor Stinner2022-05-061-3/+3
| | | | | | On slow buildbot workers, some test_ssl tests fail randomly because of short timeout (30 seconds). Use support.LONG_TIMEOUT instead which is longer and also adjusted (by regrtest --timeout option) on buildbot workers known to be slow.
* gh-82616: Add process_group support to subprocess.Popen (#23930)Gregory P. Smith2022-05-051-0/+3
| | | | | | | | One more thing that can help prevent people from using `preexec_fn`. Also adds conditional skips to two tests exposing ASAN flakiness on the Ubuntu 20.04 Address Sanitizer Github CI system. When that build is run on more modern systems the "problem" does not show up. It seems ASAN implementation related. Co-authored-by: Zackery Spytz <zspytz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-91880: add try/except around `signal.signal` (#91881)David Hewitt2022-04-251-0/+19
| | | | Fixes gh-91880.
* Simplify testing the warning filename (GH-91868)Serhiy Storchaka2022-04-244-25/+25
| | | The context manager result has the "filename" attribute.
* gh-79156: Add start_tls() method to streams API (#91453)Oleg Iarygin2022-04-151-0/+63
| | | | | | | | | | | | | The existing event loop `start_tls()` method is not sufficient for connections using the streams API. The existing StreamReader works because the new transport passes received data to the original protocol. The StreamWriter must then write data to the new transport, and the StreamReaderProtocol must be updated to close the new transport correctly. The new StreamWriter `start_tls()` updates itself and the reader protocol to the new SSL transport. Co-authored-by: Ian Good <icgood@gmail.com>
* bpo-47167: Allow overriding a future compliance check in asyncio.Task (GH-32197)Andrew Svetlov2022-04-011-1/+9
|
* bpo-39622: Interrupt the main asyncio task on Ctrl+C (GH-32105)Andrew Svetlov2022-03-301-1/+58
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-47062: Rename factory argument to loop_factory (GH-32113)Andrew Svetlov2022-03-251-1/+1
|
* bpo-43352: Add a Barrier object in asyncio lib (GH-24903)Duprat2022-03-251-2/+576
| | | | Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-47118: Fix asyncio.Runner tests error (32117)Andrew Svetlov2022-03-251-1/+1
|
* bpo-47062: Implement asyncio.Runner context manager (GH-31799)Andrew Svetlov2022-03-241-0/+133
| | | Co-authored-by: Zachary Ware <zach@python.org>
* bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase ↵Andrew Svetlov2022-03-231-47/+18
| | | | (GH-32086)
* bpo-46829: Deprecate passing a message into Future.cancel() and ↵Andrew Svetlov2022-03-233-15/+59
| | | | | Task.cancel() (GH-31840) After a long deliberation we ended up feeling that the message argument for Future.cancel(), added in 3.9, was a bad idea, so we're deprecating it in 3.11 and plan to remove it in 3.13.
* bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910)Andrew Svetlov2022-03-221-0/+25
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-47076: Make asyncio.Queue stable on slow test boxes (GH-32040)Andrew Svetlov2022-03-221-21/+11
|
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-0/+2
| | | | | | | | | | | - Add requires_fork and requires_subprocess to more tests - Skip extension import tests if dlopen is not available - Don't assume that _testcapi is a shared extension - Skip a lot of socket tests that don't work on Emscripten - Skip mmap tests, mmap emulation is incomplete - venv does not work yet - Cannot get libc from executable The "entire" test suite is now passing on Emscripten with EMSDK from git head (91 suites are skipped).
* bpo-34790: Remove passing coroutine objects to asyncio.wait() (GH-31964)Andrew Svetlov2022-03-171-48/+7
| | | Co-authored-by: Yury Selivanov <yury@edgedb.com>
* bpo-47038: Increase a test timeout for slow CI machines (GH-31951)Andrew Svetlov2022-03-171-1/+1
|
* bpo-47038: Rewrite missed asyncio.wait_for test to use ↵Andrew Svetlov2022-03-162-26/+24
| | | | IsolatedAnsyncioTestCase (GH-31946)
* bpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase ↵Andrew Svetlov2022-03-163-313/+270
| | | | (GH-31942)
* Rewrite asyncio.Queue tests with IsolatedAsyncioTestCace (#31935)Andrew Svetlov2022-03-161-324/+179
|
* bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)Maximilian Hils2022-03-151-0/+8
|
* bpo-46994: Accept explicit contextvars.Context in asyncio create_task() API ↵Andrew Svetlov2022-03-142-2/+104
| | | | (GH-31837)
* bpo-46805: Add low level UDP socket functions to asyncio (GH-31455)Alex Grönholm2022-03-132-1/+99
|
* bpo-46995: Deprecate missing asyncio.Task.set_name() for third-party task ↵Andrew Svetlov2022-03-131-1/+0
| | | | | implementations (GH-31838) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* bpo-46198: Fix `test_asyncio.test_sslproto` (GH-31801)Alex Waygood2022-03-101-0/+1
| | | GH-30297 removed a duplicate `from test import support` statement from `test_asyncio.test_sslproto`. However, in between that PR being filed and it being merged, GH-31275 removed the _other_ `from test import support` statement. This means that `support` is now undefined in `test_asyncio.test_sslproto`, causing the CI to fail on all platforms for all PRS.
* bpo-46198: rename duplicate tests and remove unused code (GH-30297)Nikita Sobolev2022-03-101-1/+0
|
* bpo-46771: Implement asyncio context managers for handling timeouts (GH-31394)Andrew Svetlov2022-03-101-0/+229
| | | | | | | | | | Example: async with asyncio.timeout(5): await some_task() Will interrupt the await and raise TimeoutError if some_task() takes longer than 5 seconds. Co-authored-by: Guido van Rossum <guido@python.org>
* Remove trailing spaces (GH-31695)Serhiy Storchaka2022-03-051-2/+2
|
* bpo-46771: Remove two controversial lines from Task.cancel() (GH-31623)Guido van Rossum2022-02-281-1/+5
| | | | | | | | | | | | | | | Also from the _asyncio C accelerator module, and adjust one test that the change caused to fail. For more discussion see the discussion starting here: https://github.com/python/cpython/pull/31394#issuecomment-1053545331 (Basically, @asvetlov proposed to return False from cancel() when there is already a pending cancellation, and I went along, even though it wasn't necessary for the task group implementation, and @agronholm has come up with a counterexample that fails because of this change. So now I'm changing it back to the old semantics (but still bumping the counter) until we can have a proper discussion about this.)
* Taskgroup tweaks (GH-31559)Tin Tvrtković2022-02-261-7/+19
| | | Now uses .cancel()/.uncancel(), for even fewer broken edge cases.
* Inherit asyncio proactor datagram transport from asyncio.DatagramTransport ↵Andrew Svetlov2022-02-221-0/+1
| | | | (#31512)
* bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)Thomas Grainger2022-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>
* bpo-46822: Increase timeout for test_create_server_ssl_over_ssl to match ↵Steve Dower2022-02-221-1/+1
| | | | underlying timeouts (GH-31502)
* bpo-45390: Propagate CancelledError's message from cancelled task to its ↵Andrew Svetlov2022-02-211-16/+50
| | | | | | awaiter (GH-31383) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-46796: Simplify handling of removed parameter "loop" in asyncio (GH-31431)Serhiy Storchaka2022-02-211-2/+2
|
* bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187)Nikita Sobolev2022-02-201-0/+14
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* Reduce flakiness of taskgroups test 13 (GH-31411)Guido van Rossum2022-02-181-1/+1
|
* bpo-46752: Slight improvements to TaskGroup API (GH-31398)Guido van Rossum2022-02-181-6/+13
| | | | | | | | | | | | | | | | | * Remove task group names (for now) We're not sure that they are needed, and once in the code we would never be able to get rid of them. Yury wrote: > Ideally, there should be a way for someone to build a "trace" > of taskgroups/task leading to the current running task. > We could do that using contextvars, but I'm not sure we should > do that in 3.11. * Pass optional name on to task in create_task() * Remove a bunch of unused stuff
* bpo-46752: Add TaskGroup; add Task..cancelled(),.uncancel() (GH-31270)Guido van Rossum2022-02-152-0/+739
| | | | | | | | | | | | | | | | | asyncio/taskgroups.py is an adaptation of taskgroup.py from EdgeDb, with the following key changes: - Allow creating new tasks as long as the last task hasn't finished - Raise [Base]ExceptionGroup (directly) rather than TaskGroupError deriving from MultiError - Instead of monkey-patching the parent task's cancel() method, add a new public API to Task The Task class has a new internal flag, `_cancel_requested`, which is set when `.cancel()` is called successfully. The `.cancelling()` method returns the value of this flag. Further `.cancel()` calls while this flag is set return False. To reset this flag, call `.uncancel()`. Thus, a Task that catches and ignores `CancelledError` should call `.uncancel()` if it wants to be cancellable again; until it does so, it is deemed to be busy with uninterruptible cleanup. This new Task API helps solve the problem where TaskGroup needs to distinguish between whether the parent task being cancelled "from the outside" vs. "from inside". Co-authored-by: Yury Selivanov <yury@edgedb.com> Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-44011: New asyncio ssl implementation (#31275)Kumar Aditya2022-02-154-60/+1755
| | | | | | | | | | | * bpo-44011: New asyncio ssl implementation Co-Authored-By: Andrew Svetlov <andrew.svetlov@gmail.com> * fix warning * fix typo Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* Fix warning: asyncio.events._event_loop_policy was modified by test_asyncio ↵Andrew Svetlov2022-02-106-4/+28
| | | | (GH-31253)
* bpo-26552: Fixed case where failing `asyncio.ensure_future` did not close ↵Kumar Aditya2022-01-281-1/+12
| | | | the coroutine (#30288)
* fixed flaky test (GH-30845)Kumar Aditya2022-01-241-5/+7
|
* bpo-41682: Skip unstable test_asyncio sendfile test on Windows (GH-30801)Nikita Sobolev2022-01-221-0/+2
|