summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_windows_events.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.10] GH-100573: Fix server hang caused by os.stat() on named pipe ↵Miss Islington (bot)2023-01-131-0/+40
| | | | | | (Windows) (GH-100959) (#101020) (cherry picked from commit 1bc7a736837272b15ad3a7aa472977bc720d1033)
* [3.10] gh-98793: Fix typecheck in `overlapped.c` (GH-98835) (#98890)Charlie Zhao2022-10-311-0/+11
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> (cherry picked from commit 3ac8c0ab6ee819a14b1c8e0992acbaf376a46058)
* 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-39010: Fix errors logged on proactor loop restart (#22017)Ben Darnell2020-08-311-0/+20
| | | | | | 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-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-38242: Revert "bpo-36889: Merge asyncio streams (GH-13251)" (#16482)Yury Selivanov2019-09-301-8/+4
| | | See https://bugs.python.org/issue38242 for more details
* 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>
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-3/+0
|
* bpo-37278: Fix test_asyncio ProactorLoopCtrlC (GH-14074)Victor Stinner2019-06-141-7/+8
| | | | | | | | | | | | | Join the thread to prevent leaking a running thread and leaking a reference. Cleanup also the test: * asyncioWindowsProactorEventLoopPolicy became the default policy, there is no need to set it manually. * Only start the thread once the loop is running. * Use a shorter sleep in the thread (100 ms rather than 1 sec). * Use close_loop(loop) rather than loop.close(). * Use longer variable names.
* bpo-36889: Merge asyncio streams (GH-13251)Andrew Svetlov2019-05-271-6/+8
| | | https://bugs.python.org/issue36889
* Pass _asyncio_internal=True into stream tests on windows (#13442)Andrew Svetlov2019-05-201-2/+4
|
* bpo-35568: add 'raise_signal' function (GH-11335)Vladimir Matveev2019-01-081-1/+1
| | | | | | As in title, expose C `raise` function as `raise_function` in `signal` module. Also drop existing `raise_signal` in `_testcapi` module and replace all usages with new function. https://bugs.python.org/issue35568
* bpo-23057: Use 'raise' to emulate ctrl-c in proactor tests (#11274)Vladimir Matveev2019-01-051-13/+19
|
* bpo-23057: add loop self socket as wakeup fd for signals (#11135)Vladimir Matveev2018-12-181-0/+21
|
* bpo-33792: Add selector and proactor windows policies (GH-7487)Yury Selivanov2018-06-081-0/+31
|
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-021-0/+4
| | | | tests (GH-7328)
* bpo-32327: Convert asyncio functions documented as coroutines to coroutines. ↵Yury Selivanov2017-12-151-1/+1
| | | | (#4872)
* bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785)Yury Selivanov2017-12-111-1/+1
|
* bpo-32193: Convert asyncio to async/await usage (#4753)Andrew Svetlov2017-12-081-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Convert asyncio/tasks.py to async/await * Convert asyncio/queues.py to async/await * Convert asyncio/test_utils.py to async/await * Convert asyncio/base_subprocess.py to async/await * Convert asyncio/subprocess.py to async/await * Convert asyncio/streams.py to async/await * Fix comments * Convert asyncio/locks.py to async/await * Convert asyncio.sleep to async def * Add a comment * Add missing news * Convert stubs from AbstrctEventLoop to async functions * Convert subprocess_shell/subprocess_exec * Convert connect_read_pipe/connect_write_pip to async/await syntax * Convert create_datagram_endpoint * Convert create_unix_server/create_unix_connection * Get rid of old style coroutines in unix_events.py * Convert selector_events.py to async/await * Convert wait_closed and create_connection * Drop redundant line * Convert base_events.py * Code cleanup * Drop redundant comments * Fix indentation * Add explicit tests for compatibility between old and new coroutines * Convert windows event loop to use async/await * Fix double awaiting of async function * Convert asyncio/locks.py * Improve docstring * Convert tests to async/await * Convert more tests * Convert more tests * Convert more tests * Convert tests * Improve test
* bpo-32154: Remove asyncio.selectors (#4605)Victor Stinner2017-11-281-1/+1
| | | | | | | | | | | | * Remove asyncio.selectors and asyncio._overlapped symbols from the namespace of the asyncio module * Replace "from asyncio import selectors" with "import selectors" * Replace "from asyncio import _overlapped" with "import _overlapped" asyncio.selectors was added to support Python 3.3, which doesn't have selectors in its standard library, and Python 3.4 in the same code base. Same rationale for asyncio._overlapped. Python 3.3 reached its end of life, and asyncio is no more maintained as a third party module on PyPI.
* asyncio: use directly socket.socketpair() (#4597)Victor Stinner2017-11-281-1/+2
| | | | | Since Python 3.5, socket.socketpair() is also available on Windows, and so can be used directly, rather than using asyncio.windows_utils.socketpair().
* bpo-31008: Fix asyncio test_wait_for_handle on Windows (#3065)Victor Stinner2017-08-101-1/+3
|
* Issue #28613: Fix get_event_loop() to return the current loopYury Selivanov2016-11-041-0/+1
| | | | when called from coroutines or callbacks.
* asyncio: sync with github asyncioVictor Stinner2015-07-091-2/+4
| | | | | * queues: get coroutine from asyncio.coroutines, not from asyncio.tasks * tets: replace tulip with asyncio in comments
* asyncio: async() function is deprecated in favour of ensure_future().Yury Selivanov2015-05-111-1/+1
|
* Issue #23293, asyncio: Rewrite IocpProactor.connect_pipe() as a coroutineVictor Stinner2015-01-261-0/+13
| | | | | | | Use a coroutine with asyncio.sleep() instead of call_later() to ensure that the schedule call is cancelled. Add also a unit test cancelling connect_pipe().
* Tulip issue 184: Fix test_pipe() on WindowsVictor Stinner2015-01-131-1/+2
| | | | Pass explicitly the event loop to StreamReaderProtocol.
* asyncio: IocpProactor.wait_for_handle() test now also checks the result of theVictor Stinner2014-12-191-2/+6
| | | | future
* Removed duplicated words in in comments and docs.Serhiy Storchaka2014-12-011-1/+1
|
* asyncio: sync with TulipVictor Stinner2014-07-241-10/+20
| | | | | | | | | | | | | | | | | | | | | | Improve stability of the proactor event loop, especially operations on overlapped objects: * Tulip issue 195: Don't call UnregisterWait() twice if a _WaitHandleFuture is cancelled twice to fix a crash. * IocpProactor.close(): cancel futures to cancel overlapped operations, instead of cancelling directly overlapped operations. Future objects may not call ov.cancel() if the future was cancelled or if the overlapped was already cancelled. The cancel() method of the future may also catch exceptions. Log also errors on cancellation. * tests: rename "f" to "fut" * Add a __repr__() method to IocpProactor * Add a destructor to IocpProactor which closes it * _OverlappedFuture.cancel() doesn't cancel the overlapped anymore if it is done: if it is already cancelled or completed. Log also an error if the cancellation failed. * Add the address of the overlapped object in repr(_OverlappedFuture) * _OverlappedFuture truncates the source traceback to hide the call to the parent constructor (useless in debug).
* asyncio tests: relax timings for slow buildbotsVictor Stinner2014-07-241-4/+4
|
* asyncio: Fix pyflakes errorsVictor Stinner2014-06-181-0/+1
| | | | | | - Add a missing import - Remove an unused import - Remove unused variables
* asyncio: Refactor tests: add a base TestCase classVictor Stinner2014-06-171-6/+2
|
* asyncio: Fix pyflakes warnings: remove unused variables and importsVictor Stinner2014-02-261-2/+1
|
* Oops, undo unwanted changes in test_asyncio: mistakes of my the last sync withVictor Stinner2014-02-031-1/+1
| | | | Tulip (changeset d7ac90c0463a)
* Issue #20400: Merge Tulip into Python: add the new asyncio.subprocess moduleVictor Stinner2014-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | * Add a new asyncio.subprocess module * Add new create_subprocess_exec() and create_subprocess_shell() functions * The new asyncio.subprocess.SubprocessStreamProtocol creates stream readers for stdout and stderr and a stream writer for stdin. * The new asyncio.subprocess.Process class offers an API close to the subprocess.Popen class: - pid, returncode, stdin, stdout and stderr attributes - communicate(), wait(), send_signal(), terminate() and kill() methods * Remove STDIN (0), STDOUT (1) and STDERR (2) constants from base_subprocess and unix_events, to not be confused with the symbols with the same name of subprocess and asyncio.subprocess modules * _ProactorBasePipeTransport.get_write_buffer_size() now counts also the size of the pending write * _ProactorBaseWritePipeTransport._loop_writing() may now pause the protocol if the write buffer size is greater than the high water mark (64 KB by default)
* test_asyncio: relax timing, the "AMD64 Windows Server 2008 [SB] 3.x" buildbotVictor Stinner2014-02-011-1/+1
| | | | looks to be slow
* Update asyncio from the Tulip projectVictor Stinner2014-01-251-15/+10
| | | | | | | | | | | | | | | | Major changes: - StreamReader.readexactly() now raises an IncompleteReadError if the end of stream is reached before we received enough bytes, instead of returning less bytes than requested. - Unit tests use the main asyncio module instead of submodules like events - _UnixWritePipeTransport now also supports character devices, as _UnixReadPipeTransport. Patch written by Jonathan Slenders. - Export more symbols: BaseEventLoop, BaseProactorEventLoop, BaseSelectorEventLoop, Queue and Queue sublasses, Empty, Full
* Fix ResourceWarning in test_asyncio.test_windows_events:Victor Stinner2014-01-101-0/+1
| | | | close the write end of the socket pair
* Issue #19952: test_asyncio: relax timings of Windows events, buildbots areVictor Stinner2013-12-131-2/+2
| | | | sometimes busy
* Relax timing on test_asyncio for busy (slow) Windows buildbotsVictor Stinner2013-11-181-1/+1
| | | | | | | | | | | | http://buildbot.python.org/all/builders/AMD64%20Windows%20Server%202008%20%5BSB%5D%203.x/builds/1649/steps/test/logs/stdio ====================================================================== FAIL: test_wait_for_handle (test.test_asyncio.test_windows_events.ProactorTests) ---------------------------------------------------------------------- Traceback (most recent call last): File "E:\home\cpython\buildslave\x64\3.x.snakebite-win2k8r2sp1-amd64\build\lib\test\test_asyncio\test_windows_events.py", line 112, in test_wait_for_handle self.assertTrue(0.18 < elapsed < 0.22, elapsed) AssertionError: False is not true : 0.25
* asyncio: Various style nits.Guido van Rossum2013-11-011-1/+1
|
* asyncio: Make the IOCP proactor support "waitable" handles (Richard Oudkerk).Guido van Rossum2013-10-301-0/+40
|
* Make various asyncio test files individually runnableAntoine Pitrou2013-10-201-0/+4
|
* Initial checkin of asyncio package (== Tulip, == PEP 3156).Guido van Rossum2013-10-171-0/+95