summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socketserver.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-103673: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer ↵jb21702023-04-241-10/+2
| | | | | | | | | | | | | | | | socketservers (#103674) sockserver gains ForkingUnixStreamServer and ForkingUnixDatagramServer classes for consistency with all of the others. Ironically these existed but were buried in our test suite. Addresses #103673 <!-- gh-issue-number: gh-103673 --> * Issue: gh-103673 <!-- /gh-issue-number --> --------- Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* gh-103716: Add test support requires fork in simple_subprocess (gh-103717)Ankit Kumar Pandey2023-04-231-1/+1
| | | add requires fork as test case depends on this
* gh-93852: Add test.support.create_unix_domain_name() (#93914)Victor Stinner2022-06-171-3/+1
| | | | | | | | | | | | | | | test_asyncio, test_logging, test_socket and test_socketserver now create AF_UNIX domains in the current directory to no longer fail with OSError("AF_UNIX path too long") if the temporary directory (the TMPDIR environment variable) is too long. Modify the following tests to use create_unix_domain_name(): * test_asyncio * test_logging * test_socket * test_socketserver test_asyncio.utils: remove unused time import.
* gh-84461: Skip network require tests on Emscripten (GH-92383)Christian Heimes2022-05-061-0/+2
|
* bpo-40280: Skip socket, fork, subprocess tests on Emscripten (GH-31986)Christian Heimes2022-03-221-1/+1
| | | | | | | | | | | - 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-43843: libregrtest uses threading.excepthook (GH-25400)Victor Stinner2021-04-161-2/+5
| | | | | | | | | test.libregrtest now marks a test as ENV_CHANGED (altered the execution environment) if a thread raises an exception but does not catch it. It sets a hook on threading.excepthook. Use --fail-env-changed option to mark the test as failed. libregrtest regrtest_unraisable_hook() explicitly flushs sys.stdout, sys.stderr and sys.__stderr__.
* bpo-37193: Remove thread objects which finished process its request (GH-23127)Jason R. Coombs2020-12-311-0/+23
| | | This reverts commit aca67da4fe68d5420401ac1782203d302875eb27.
* Revert "bpo-37193: remove thread objects which finished process its request ↵Jason R. Coombs2020-11-021-24/+0
| | | | | (GH-13893)" (GH-23107) This reverts commit c41559021213cfc9dc62a83fc63306b3bdc3e64b.
* bpo-37193: remove thread objects which finished process its request (GH-13893)MARUYAMA Norihiro2020-11-011-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-37193: remove the thread which finished process request from threads list * rename variable t to thread. * don't remove thread from list if it is daemon. * use lock to protect self._threads. * use finally block in case of exception from shutdown_request(). * check "not thread.daemon" before lock to avoid holding the lock if it's unnecessary. * fix the place of _threads_lock. * separate code to remove a current thread into a function. * check ValueError when removing thread. * fix wrong code which all instance shared same lock. * Extract thread management into a _Threads class to encapsulate atomic operations and separate concerns. * Replace multiple references of 'block_on_close' with one, avoiding the possibility that 'block_on_close' could change during the course of processing requests. Now, there's exactly one _threads object with behavior fixed for the duration. * Add docstrings to private classes. * Add test to ensure that a ThreadingTCPServer can be closed without serving any requests. * Use _NoThreads as the default value. Fixes AttributeError when server is closed without serving any requests. * Add blurb * Add test capturing failure. Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-40275: Use new test.support helper submodules in tests (GH-21743)Hai Shi2020-08-061-4/+5
|
* bpo-40275: Adding threading_helper submodule in test.support (GH-20263)Hai Shi2020-05-271-3/+4
|
* bpo-40275: Avoid importing socket in test.support (GH-19603)Serhiy Storchaka2020-04-251-1/+2
| | | | | | * Move socket related functions from test.support to socket_helper. * Import socket, nntplib and urllib.error lazily in transient_internet(). * Remove importing multiprocess.
* bpo-40094: Add test.support.wait_process() (GH-19254)Victor Stinner2020-03-311-3/+1
| | | | | | | | | Moreover, the following tests now check the child process exit code: * test_os.PtyTests * test_mailbox.test_lock_conflict() * test_tempfile.test_process_awareness() * test_uuid.testIssue8621() * multiprocessing resource tracker tests
* bpo-38614: Use test.support.SHORT_TIMEOUT constant (GH-17566)Victor Stinner2019-12-111-1/+1
| | | | | | | | | | | | | | | Replace hardcoded timeout constants in tests with SHORT_TIMEOUT of test.support, so it's easier to ajdust this timeout for all tests at once. SHORT_TIMEOUT is 30 seconds by default, but it can be longer depending on --timeout command line option. The change makes almost all timeouts longer, except test_reap_children() of test_support which is made 2x shorter: SHORT_TIMEOUT should be enough. If this test starts to fail, LONG_TIMEOUT should be used instead. Uniformize also "from test import support" import in some test files.
* bpo-22831: Use "with" to avoid possible fd leaks in tests (part 2). (GH-10929)Serhiy Storchaka2019-03-051-19/+17
|
* bpo-29184: Skip test_socketserver tests on PermissionError raised by Android ↵xdegaye2017-11-181-5/+14
| | | | (GH-4387)
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-8/+2
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* bpo-31151: Add socketserver.ForkingMixIn.server_close() (#3057)Victor Stinner2017-08-101-4/+5
| | | | | | | | | * Add socketserver.ForkingMixIn.server_close() bpo-31151: socketserver.ForkingMixIn.server_close() now waits until all child processes completed to prevent leaking zombie processes. * Fix test on Windows which doesn't have ForkingMixIn
* Use sequence repetition instead of bytes constructor with integer argument.Serhiy Storchaka2016-09-111-1/+1
|
* Issue #26721: Change StreamRequestHandler.wfile to BufferedIOBaseMartin Panter2016-06-291-0/+79
|
* Issue25931: fix tests broken by the conditional define of socketserver.Forking*Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-06-031-6/+7
|
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-2/+0
|
* Issue #26404: Add context manager to socketserver, by Aviv PalivodaMartin Panter2016-04-131-1/+6
|
* Issue #5824: Merge socketserver tests from 3.5Martin Panter2016-02-241-21/+20
|\
| * Issue #5824: Fix DatagramRequestHandler tests by binding the client socketMartin Panter2016-02-241-21/+20
| |
* | Issue #23430: Stop socketserver from catching SystemExit etc from handlersMartin Panter2016-02-211-0/+92
|/ | | | | Also make handle_error() consistently output to stderr, and fix the documentation.
* Issue #26309: Rewrite test in main thread and avoid race conditionMartin Panter2016-02-191-24/+21
|
* Issue #26309: Shut down socketserver request if verify_request() is falseMartin Panter2016-02-181-0/+24
| | | | Patch by Aviv Palivoda.
* Issue #23254: Document how to close the TCPServer listening socket.Robert Collins2015-07-291-0/+1
|\ | | | | | | Patch from Martin Panter.
| * Issue #23254: Document how to close the TCPServer listening socket.Robert Collins2015-07-291-0/+1
| | | | | | | | Patch from Martin Panter.
* | Issue #23358: Add missing BaseServer entry to socketserver.__all__.Berker Peksag2015-02-031-7/+12
|\ \ | |/ | | | | Patch by Martin Panter.
| * Issue #23358: Add missing BaseServer entry to socketserver.__all__.Berker Peksag2015-02-031-7/+12
| | | | | | | | Patch by Martin Panter.
* | Issue #22435: Fix a file descriptor leak when SocketServer bind fails.Charles-François Natali2014-10-131-0/+10
|\ \ | |/
| * Issue #22435: Fix a file descriptor leak when SocketServer bind fails.Charles-François Natali2014-10-131-0/+10
| |
* | Issue #21040: socketserver: Use the selectors module.Charles-François Natali2014-03-241-32/+0
|/
* Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-39/+46
|
* Issue #17177: The imp module is pending deprecation.Brett Cannon2013-06-161-1/+1
| | | | | | To make sure there is no issue with code that is both Python 2 and 3 compatible, there are no plans to remove the module any sooner than Python 4 (unless the community moves to Python 3 solidly before then).
* Issue #16706: get rid of os.errorAndrew Svetlov2012-12-181-1/+1
|
* Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
|\ | | | | | | Patch by Serhiy Storchaka.
| * Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
| |\ | | | | | | | | | Patch by Serhiy Storchaka.
| | * Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
| | | | | | | | | | | | Patch by Serhiy Storchaka.
| | * Fix the patch for issue #7978: select() raises select.error before 3.3, not ↵Antoine Pitrou2012-04-081-1/+1
| |/ | | | | | | OSError.
* | #16135: Removal of OS/2 support (Remove OS2 and OS/2 references)Jesus Cea2012-10-051-15/+1
|/
* Fix flakiness in test_socketserverAntoine Pitrou2012-04-081-1/+4
|
* Issue #7978: socketserver now restarts the select() call when EINTR is returned.Antoine Pitrou2012-04-081-0/+34
| | | | | This avoids crashing the server loop when a signal is received. Patch by Jerzy Kozera.
* Closes #13140: Fix the daemon_threads attribute of ThreadingMixIn.Florent Xicluna2011-11-041-1/+0
|
* Issue #12250: test_socketserver uses a timeout of 60 seconds instead of 20Victor Stinner2011-07-141-2/+1
| | | | | test_shutdown() may fail on very slow buildbots like FreeBSD 6.4 just because of the arbitrary timeout.
* test_sockserver: close servers when doneVictor Stinner2011-01-031-0/+2
|
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-5/+5
|
* Merged revisions 81543 via svnmerge fromVictor Stinner2010-05-261-0/+1
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81543 | victor.stinner | 2010-05-26 19:25:28 +0200 (mer., 26 mai 2010) | 2 lines Issue #7449: Skip test_socketserver if threading support is disabled ........