summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_asyncio/test_server.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336) ↵Miss Islington (bot)2023-10-281-4/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#111424) gh-79033: Try to fix asyncio.Server.wait_closed() again (GH-111336) * Try to fix asyncio.Server.wait_closed() again I identified the condition that `wait_closed()` is intended to wait for: the server is closed *and* there are no more active connections. When this condition first becomes true, `_wakeup()` is called (either from `close()` or from `_detach()`) and it sets `_waiters` to `None`. So we just check for `self._waiters is None`; if it's not `None`, we know we have to wait, and do so. A problem was that the new test introduced in 3.12 explicitly tested that `wait_closed()` returns immediately when the server is *not* closed but there are currently no active connections. This was a mistake (probably a misunderstanding of the intended semantics). I've fixed the test, and added a separate test that checks exactly for this scenario. I also fixed an oddity where in `_wakeup()` the result of the waiter was set to the waiter itself. This result is not used anywhere and I changed this to `None`, to avoid a GC cycle. * Update Lib/asyncio/base_events.py --------- (cherry picked from commit 26553695592ad399f735d4dbaf32fd871d0bb1e1) Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
* GH-79033: Fix asyncio.Server.wait_closed() (#98582)Guido van Rossum2022-11-241-0/+27
| | | | | | | | | | | 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
* bpo-42392: Remove loop parameter from asyncio.streams (GH-23517)Yurii Karabas2020-11-261-6/+4
|
* bpo-40443: Remove unused imports in tests (GH-19804)Victor Stinner2020-04-301-1/+0
|
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-2/+3
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-1/+0
|
* bpo-36889: Merge asyncio streams (GH-13251)Andrew Svetlov2019-05-271-4/+6
| | | https://bugs.python.org/issue36889
* bpo-37027: Return a proxy socket object from transp.get_extra_info('socket') ↵Yury Selivanov2019-05-271-2/+2
| | | | | | | | | | (GH-13530) Return a safe to use proxy socket object from `transport.get_extra_info('socket')` https://bugs.python.org/issue37027
* bpo-36341: Fix tests calling bind() on AF_UNIX sockets (GH-12399)xdegaye2019-05-031-1/+1
| | | | | | | Those tests may fail with PermissionError. https://bugs.python.org/issue36341
* bpo-33562: Check the global asyncio event loop policy isn't set after any ↵Brett Cannon2018-06-021-0/+4
| | | | tests (GH-7328)
* bpo-32662: Try making test_asyncio.test_server more reliable (#5338)Yury Selivanov2018-01-261-1/+12
|
* bpo-32662: Implement Server.start_serving() and Server.serve_forever() (#5312)Yury Selivanov2018-01-251-0/+117
* bpo-32662: Implement Server.start_serving() and Server.serve_forever() New methods: * Server.start_serving(), * Server.serve_forever(), and * Server.is_serving(). Add 'start_serving' keyword parameter to loop.create_server() and loop.create_unix_server().