summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_socketserver.py
Commit message (Collapse)AuthorAgeFilesLines
* change a few uses of the threading APIsBenjamin Peterson2008-08-181-1/+1
|
* give the threading API PEP 8 namesBenjamin Peterson2008-06-111-1/+1
|
* socketserver renaming reversal part 3: move the module into the rightGeorg Brandl2008-05-241-29/+29
| | | | place and fix all references to it. Closes #2926.
* Updated all import statements to use the new socketserver module name.Alexandre Vassalotti2008-05-121-29/+29
| | | | | Renamed socketserver module in its own documentation. Renamed documentation references.
* - Issue #2550: The approach used by client/server code for obtaining portsTrent Nelson2008-04-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to listen on in network-oriented tests has been refined in an effort to facilitate running multiple instances of the entire regression test suite in parallel without issue. test_support.bind_port() has been fixed such that it will always return a unique port -- which wasn't always the case with the previous implementation, especially if socket options had been set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT). The new implementation of bind_port() will actually raise an exception if it is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or SO_REUSEPORT socket option set. Furthermore, if available, bind_port() will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed. This currently only applies to Windows. This option prevents any other sockets from binding to the host/port we've bound to, thus removing the possibility of the 'non-deterministic' behaviour, as Microsoft puts it, that occurs when a second SOCK_STREAM socket binds and accepts to a host/port that's already been bound by another socket. The optional preferred port parameter to bind_port() has been removed. Under no circumstances should tests be hard coding ports! test_support.find_unused_port() has also been introduced, which will pass a temporary socket object to bind_port() in order to obtain an unused port. The temporary socket object is then closed and deleted, and the port is returned. This method should only be used for obtaining an unused port in order to pass to an external program (i.e. the -accept [port] argument to openssl's s_server mode) or as a parameter to a server-oriented class that doesn't give you direct access to the underlying socket used. Finally, test_support.HOST has been introduced, which should be used for the host argument of any relevant socket calls (i.e. bind and connect). The following tests were updated to following the new conventions: test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib, test_poplib, test_ftplib, test_telnetlib, test_socketserver, test_asynchat and test_socket_ssl. It is now possible for multiple instances of the regression test suite to run in parallel without issue.
* Try to prevent the alarm going off early in tearDownNeal Norwitz2008-03-231-1/+1
|
* Revert r61650; the intent of this commit was to try and address alarm ↵Trent Nelson2008-03-201-4/+1
| | | | failures on some of the build slaves. As Neal points out, it's called after test_main(), so it's not going to factor into the test when run via regrtest.py (and removes the original functionality that Jeffrey wanted that would kill the test if it took longer than 3 seconds to run when executing it directly during development).
* Bump the SIGALM delay from 3 seconds to 20 seconds, mainly in an effort to ↵Trent Nelson2008-03-191-1/+4
| | | | see if it fixes the alarm failures in this test experienced by some of the buildbots.
* Progress on issue #1193577 by adding a polling .shutdown() method toJeffrey Yasskin2008-03-071-47/+29
| | | | | | SocketServers. The core of the patch was written by Pedro Werneck, but any bugs are mine. I've also rearranged the code for timeouts in order to avoid interfering with the shutdown poll.
* Fix test_socketserver on Windows after r61099 added several signal.alarm()Jeffrey Yasskin2008-03-051-3/+7
| | | | | | calls (which don't exist on non-Unix platforms). Thanks to Trent Nelson for the report and patch.
* Prevent SocketServer.ForkingMixIn from waiting on child processes that itJeffrey Yasskin2008-02-281-10/+26
| | | | | didn't create, in most cases. When there are max_children handlers running, it will still wait for any child process, not just handler processes.
* Speed test_socketserver up from 28.739s to 0.226s, simplify the logic, and makeJeffrey Yasskin2008-02-281-109/+108
| | | | sure all tests run even if some fail.
* Patch #2167 from calvin: Remove unused importsChristian Heimes2008-02-231-1/+0
|
* Let test_socketserver pass on win32, which does not have AF_UNIX sockets.Amaury Forgeot d'Arc2008-02-031-7/+8
|
* Wait for a delay before reaping children -- this should fix theGeorg Brandl2008-02-031-1/+2
| | | | test_socketserver failures on several platforms.
* Rewrite test_socketserver as unittest, written for GHOP by Benjamin Petersen.Georg Brandl2008-02-021-146/+177
|
* Reap children before the test starts so hopefully SocketServerNeal Norwitz2007-08-261-0/+1
| | | | | won't find any old children left around which causes an exception in collect_children() and the test to fail.
* Fix a race condition in this test -- instead of assuming that it will takeGuido van Rossum2007-04-041-1/+5
| | | | | the test server thread at most 0.5 seconds to get ready, use an event variable.
* Convert an assert to a raise so it works even in the presence of -O.Collin Winter2007-03-101-2/+4
|
* Bug #1531963: Make SocketServer.TCPServer's server_address always be equal ↵Collin Winter2007-03-101-0/+1
| | | | | | to calling getsockname() on the server's socket. Will backport.
* Fix the test for SocketServer so it should pass on cygwin and not failNeal Norwitz2006-08-151-0/+9
| | | | | | | | sporadically on other platforms. This is really a band-aid that doesn't fix the underlying issue in SocketServer. It's not clear if it's worth it to fix SocketServer, however, I opened a bug to track it: http://python.org/sf/1540386
* Add new utility function, reap_children(), to test_support. This shouldNeal Norwitz2006-06-291-1/+3
| | | | | | | | | | be called at the end of each test that spawns children (perhaps it should be called from regrtest instead?). This will hopefully prevent some of the unexplained failures in the buildbots (hppa and alpha) during tests that spawn children. The problems were not reproducible. There were many zombies that remained at the end of several tests. In the worst case, this shouldn't cause any more problems, though it may not help either. Time will tell.
* Fix the socket tests so they can be run concurrently. Backport candidateNeal Norwitz2006-06-121-1/+25
|
* Fixes for AF_UNIX support on OS/2:Andrew MacIntyre2004-04-111-4/+19
| | | | | | | | | - return the full size of the sockaddr_un structure, without which bind() fails with EINVAL; - set test_socketserver to use a socket name that meets the form required by the underlying implementation; - don't bother exercising the forking AF_UNIX tests on EMX - its fork() can't handle the stress.
* Replace backticks with repr() or "%r"Walter Dörwald2004-02-121-1/+1
| | | | From SF patch #852334.
* EMX fork() emulation not good enough to cope with test_socketserverAndrew MacIntyre2003-01-021-2/+2
|
* Get rid of relative imports in all unittests. Now anything thatBarry Warsaw2002-07-231-2/+2
| | | | | | | | | | | imports e.g. test_support must do so using an absolute package name such as "import test.test_support" or "from test import test_support". This also updates the README in Lib/test, and gets rid of the duplicate data dirctory in Lib/test/data (replaced by Lib/email/test/data). Now Tim and Jack can have at it. :)
* Use sendall() in the stream test instead of send().Guido van Rossum2001-10-291-1/+1
|
* Make test_socketserver require the network resource.Tim Peters2001-09-181-0/+2
| | | | Add it back to the list of tests we expect to skip on Windows.
* Rework akin to test_threaded_import, so that this can run under regrtest.Tim Peters2001-09-171-7/+8
| | | | | Also raise TestSkipped (intead of appearing to fail) if the import lock is held.
* Should raise TestSkipped, not ImportError, when deciding to skip theGuido van Rossum2001-07-131-2/+2
| | | | test.
* Ported to Windows:Guido van Rossum2001-07-101-5/+6
| | | | | | - Set the host to "localhost" instead of "". - Skip the AF_UNIX tests when socket.AF_UNIX is not defined.
* A test suite for SocketServer.py that exposes the various bugs justGuido van Rossum2001-07-101-0/+161
fixed. Regrettably, this must be run manually -- somehow the I/O redirection of the regression test breaks the test. When run under the regression test, this raises ImportError with a warning to that effect. Bugfix candidate!