summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_signal.py
Commit message (Collapse)AuthorAgeFilesLines
* Close #18396: fix spurious test_signal failure on WindowsNick Coghlan2013-08-031-2/+8
| | | | | signal.getsignal returns None for some signals if faulthandler is enabled (Patch by Jeremy Kloth)
* Issue #18238: Skip test_signal.test_sigwaitinfo_interrupted() on AIXVictor Stinner2013-06-171-0/+4
| | | | | sigwaitinfo() can be interrupted on Linux (raises InterruptedError), but not on AIX.
* check windows fd validity (closes #16992)Benjamin Peterson2013-01-181-2/+9
|
* Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-2/+2
|\ | | | | | | Patch by Serhiy Storchaka.
| * Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-2/+2
| | | | | | | | Patch by Serhiy Storchaka.
* | Issue #13964: signal.sigtimedwait() timeout is now a float instead of a tupleVictor Stinner2012-03-021-6/+4
| | | | | | | | Add a private API to convert an int or float to a C timespec structure.
* | Issue #13084: Fix a test_signal failure: the delivery order is only defined forCharles-François Natali2011-10-021-8/+6
| | | | | | | | real-time signals.
* | Issue #12469: fix signal order check of test_signalVictor Stinner2011-07-041-5/+6
| | | | | | | | | | | | | | When signals are unblocked, pending signal ared delivered in the reverse order of their number (also on Linux, not only on FreeBSD 6). Don't sort signals by their number if signals were not blocked (test_signum).
* | Issue #12469: test_signal checks wakeup signals order, except on freebsd6Victor Stinner2011-07-041-4/+4
| | | | | | | | | | On FreeBSD 6, when signals are unblocked, FreeBSD 6 delivers signals in the reverse order of their number.
* | Issue #12469: partial revert of 024827a9db64, freebsd6 thread initializationVictor Stinner2011-07-041-3/+0
| | | | | | | | | | | | | | * Don't create a thread at startup anymore to initialize the pthread library: it changes the behaviour of many functions related to signal handling like sigwait() * Reenable test_sigtimedwait_poll() on FreeBSD 6
* | Issue #12469: replace assertions by explicit if+raiseVictor Stinner2011-07-041-16/+32
| |
* | (merge 3.2) Issue #12469: Run wakeup and pending signal tests in a subprocessVictor Stinner2011-07-041-238/+256
|\ \ | |/ | | | | | | to run the test in a fresh process with only one thread and to not change signal handling of the parent process.
| * Issue #12469: Run "wakeup" signal tests in subprocess to run the test in aVictor Stinner2011-07-041-37/+68
| | | | | | | | | | fresh process with only one thread and to not change signal handling of the parent process.
* | (merge 3.2) Issue #12363: increase the timeout of siginterrupt() testsVictor Stinner2011-07-011-4/+4
|\ \ | |/ | | | | | | | | | | | | Move also the "ready" trigger after the installation of the signal handler and the call to siginterrupt(). Use a timeout of 5 seconds instead of 3. Two seconds are supposed to be enough, but some of our buildbots are really slow (especially the FreeBSD 6 VM).
| * Issue #12363: increase the timeout of siginterrupt() testsVictor Stinner2011-07-011-5/+5
| | | | | | | | | | | | | | | | Move also the "ready" trigger after the installation of the signal handler and the call to siginterrupt(). Use a timeout of 5 seconds instead of 3. Two seconds are supposed to be enough, but some of our buildbots are really slow (especially the FreeBSD 6 VM).
| * Issue #12363: improve siginterrupt() testsVictor Stinner2011-07-011-89/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backport commits 968b9ff9a059 and aff0a7b0cb12 from the default branch to 3.2 branch. Extract of the changelog messages: "The previous tests used time.sleep() to synchronize two processes. If the host was too slow, the test could fail. The new tests only use one process, but they use a subprocess to: - have only one thread - have a timeout on the blocking read (select cannot be used in the test, select always fail with EINTR, the kernel doesn't restart it) - not touch signal handling of the parent process" and "Add a basic synchronization code between the child and the parent processes: the child writes "ready" to stdout." I replaced .communicate(timeout=3.0) by an explicit waiting loop using Popen.poll().
* | Issue #12303: run sig*wait*() tests in a subprocesssVictor Stinner2011-06-291-56/+81
| | | | | | | | | | | | | | ... instead of using fork(): sig*wait*() functions behave differently (not correctly) after a fork, especially on FreeBSD 6. Skip also test_sigtimedwait_poll() on FreeBSD 6 because of a kernel bug.
* | Fix test_signal on Windows after #12303.Ross Lagerwall2011-06-251-6/+6
| |
* | Issue #12303: Add sigwaitinfo() and sigtimedwait() to the signal module.Ross Lagerwall2011-06-251-16/+83
| |
* | Issue #12392: fix thread initialization on FreeBSD 6Victor Stinner2011-06-241-0/+25
| | | | | | | | | | | | | | | | On FreeBSD6, pthread_kill() doesn't work on the main thread before the creation of the first thread. Create therefore a dummy thread (no-op) a startup to initialize the pthread library. Add also a test for this use case, test written by Charles-François Natali.
* | Issue #12363: improve siginterrupt() testsVictor Stinner2011-06-221-0/+7
| | | | | | | | | | Add a basic synchronization code between the child and the parent processes: the child writes "ready" to stdout.
* | Close #12363: fix a race condition in siginterrupt() testsVictor Stinner2011-06-201-74/+50
| | | | | | | | | | | | | | | | | | | | | | | | The previous tests used time.sleep() to synchronize two processes. If the host was too slow, the test could fail. The new tests only use one process, but they use a subprocess to: - have only one thread - have a timeout on the blocking read (select cannot be used in the test, select always fail with EINTR, the kernel doesn't restart it) - not touch signal handling of the parent process
* | Issue #12316: Fix sigwait() test using threadsVictor Stinner2011-06-131-29/+41
| | | | | | | | | | Spawn a new process instead of using fork(). Patch written by Charles-François Natali.
* | Issue #8407: skip sigwait() tests if pthread_sigmask() is missingVictor Stinner2011-06-101-0/+2
| | | | | | | | | | The new tests now requires pthread_sigmask(). Skip the test if the function is missing, e.g. if Python is compiled without threads.
* | Issue #8407: write error message on sigwait test failureVictor Stinner2011-06-101-3/+4
| |
* | Issue #8407: Make signal.sigwait() tests more reliableVictor Stinner2011-06-101-14/+53
| | | | | | | | | | | | | | Block the signal before calling sigwait(). Use os.fork() to ensure that we have only one thread. Initial patch written by Charles-François Natali.
* | Issue #8407: signal.sigwait() releases the GILVictor Stinner2011-06-091-0/+19
| | | | | | | | Initial patch by Charles-François Natali.
* | Issue #8407: test_signal doesn't check signal delivery orderVictor Stinner2011-05-311-5/+6
| | | | | | | | Tthe signal delivery order is not portable or reliable.
* | Close #12028: Make threading._get_ident() public, rename it toVictor Stinner2011-05-301-2/+2
| | | | | | | | | | threading.get_ident() and document it. This function was used by _thread.get_ident().
* | Issue #8407: Fix the signal handler of the signal module: if it is calledVictor Stinner2011-05-251-4/+32
| | | | | | | | twice, it now writes the number of the second signal into the wakeup fd.
* | Issue #8407: Remove debug code from test_signalVictor Stinner2011-05-081-37/+10
| | | | | | | | I don't think that we still need it.
* | Issue #8407: The signal handler writes the signal number as a single byteVictor Stinner2011-05-081-0/+15
| | | | | | | | | | instead of a nul byte into the wakeup file descriptor. So it is possible to wait more than one signal and know which signals were raised.
* | Issue #8407: Add pthread_kill(), sigpending() and sigwait() functions to theVictor Stinner2011-05-071-33/+108
| | | | | | | | signal module.
* | Issue #8407: signal.pthread_sigmask() returns a set instead of a listVictor Stinner2011-05-041-15/+18
| | | | | | | | Update the doc. Refactor also related tests.
* | Issue #11998, issue #8407: workaround _tkinter issue in test_signalVictor Stinner2011-05-041-3/+16
| | | | | | | | | | | | The _tkinter module loads the Tcl library which creates a thread waiting events in select(). This thread receives signals blocked by all other threads. We cannot test blocked signals if the _tkinter module is loaded.
* | Issue #8407: disable faulthandler timeout thread on all platformsVictor Stinner2011-05-031-14/+13
| | | | | | | | The problem is not specific to Mac OS X.
* | Issue #8407: pthread_sigmask() checks immediatly if signal handlers have beenVictor Stinner2011-05-031-14/+16
| | | | | | | | | | | | called. The test checks that SIG_UNBLOCK calls immediatly the signal handler of the pending SIGUSR1. Improve also the tests using an exception (division by zero) instead of a flag (a function attribute).
* | Issue #8407: Fix pthread_sigmask() tests on Mac OS XVictor Stinner2011-05-031-0/+15
| | | | | | | | | | Disable faulthandler timeout thread on Mac OS X: it interacts with pthread_sigmask() tests.
* | Issue #8407, issue #11859: Add signal.pthread_sigmask() function to fetchVictor Stinner2011-04-301-1/+55
|/ | | | | | | | | and/or change the signal mask of the calling thread. Fix also tests of test_io using threads and an alarm: use pthread_sigmask() to ensure that the SIGALRM signal is received by the main thread. Original patch written by Jean-Paul Calderone.
* Call reap_children() where appropriateAntoine Pitrou2011-03-201-3/+6
|
* Merged revisions 86596 via svnmerge fromEzio Melotti2010-11-211-6/+6
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r86596 | ezio.melotti | 2010-11-20 21:04:17 +0200 (Sat, 20 Nov 2010) | 1 line #9424: Replace deprecated assert* methods in the Python test suite. ........
* Merged revisions 85586-85587,85596-85598 via svnmerge fromGregory P. Smith2010-10-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85586 | gregory.p.smith | 2010-10-16 17:17:24 -0700 (Sat, 16 Oct 2010) | 2 lines fix for netbsd. ........ r85587 | gregory.p.smith | 2010-10-16 17:43:10 -0700 (Sat, 16 Oct 2010) | 3 lines applying netbsd-wizs-mod.patch from issue5510 - fixes for netbsd (and dragonflybsd?) ........ r85596 | gregory.p.smith | 2010-10-16 19:14:36 -0700 (Sat, 16 Oct 2010) | 6 lines Fix multiprocessing Semaphore's on netbsd5. SEM_VALUE_MAX is defined as (~0U) on NetBSD which was causing it to appear as -1 when used as a signed int for _multprocessing.SemLock.SEM_VALUE_MAX. This works around the problem by substituting INT_MAX on systems where it appears negative when used as an int. ........ r85597 | gregory.p.smith | 2010-10-16 19:57:19 -0700 (Sat, 16 Oct 2010) | 2 lines skip test_itimer_virtual on NetBSD to prevent the test suite from hanging. ........ r85598 | gregory.p.smith | 2010-10-16 20:09:12 -0700 (Sat, 16 Oct 2010) | 2 lines Avoid hanging the test on netbsd5. ........
* Merged revisions 85140 via svnmerge fromBrian Curtin2010-10-011-6/+6
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r85140 | brian.curtin | 2010-10-01 09:49:24 -0500 (Fri, 01 Oct 2010) | 4 lines Fix #10003. Add SIGBREAK to the set of valid signals on Windows. This fixes a regression noticed by bzr, introduced by issue #9324. ........
* Merged revisions 84556 via svnmerge fromBrian Curtin2010-09-061-3/+2
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r84556 | brian.curtin | 2010-09-06 11:04:10 -0500 (Mon, 06 Sep 2010) | 7 lines Clean up the fix to #9324 with some of the suggestions raised on python-dev in response to the original checkin. Move the validation from the original loop into a switch statement, and adjust a platform check in the tests. ........
* Merged revisions 83771 via svnmerge fromBrian Curtin2010-08-071-6/+6
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83771 | brian.curtin | 2010-08-06 22:47:21 -0500 (Fri, 06 Aug 2010) | 3 lines Fix an assertRaises situation and typo. Also pass all tests to run_unittest rather than do it by platform -- the proper skips are in place already. ........
* Merged revisions 83763 via svnmerge fromBrian Curtin2010-08-061-5/+28
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83763 | brian.curtin | 2010-08-06 14:27:32 -0500 (Fri, 06 Aug 2010) | 3 lines Fix #9324: Add parameter validation to signal.signal on Windows in order to prevent crashes. ........
* Merged revisions 81201 via svnmerge fromBenjamin Peterson2010-05-151-4/+4
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81201 | benjamin.peterson | 2010-05-15 12:52:12 -0500 (Sat, 15 May 2010) | 9 lines Merged revisions 81200 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81200 | benjamin.peterson | 2010-05-15 12:48:55 -0500 (Sat, 15 May 2010) | 1 line use TestCase skip method ........ ................
* Merged revisions 81188 via svnmerge fromStefan Krah2010-05-151-6/+4
| | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81188 | stefan.krah | 2010-05-15 11:41:27 +0200 (Sat, 15 May 2010) | 10 lines Merged revisions 81185 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81185 | stefan.krah | 2010-05-15 11:31:08 +0200 (Sat, 15 May 2010) | 4 lines If the timeout is exceeded, count the tests as skipped instead of just issuing a warning. ........ ................
* Merged revisions 81016 via svnmerge fromJean-Paul Calderone2010-05-091-18/+75
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r81016 | jean-paul.calderone | 2010-05-08 23:18:57 -0400 (Sat, 08 May 2010) | 9 lines Merged revisions 81007 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r81007 | jean-paul.calderone | 2010-05-08 16:06:02 -0400 (Sat, 08 May 2010) | 1 line Skip signal handler re-installation if it is not necessary. Issue 8354. ........ ................
* Merged revisions 80296 via svnmerge fromR. David Murray2010-04-211-0/+10
| | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/py3k ................ r80296 | r.david.murray | 2010-04-20 21:51:57 -0400 (Tue, 20 Apr 2010) | 14 lines Merged revisions 80144 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r80144 | r.david.murray | 2010-04-17 01:26:26 -0400 (Sat, 17 Apr 2010) | 8 lines Issue #3864: Skip three test_signal tests on freebsd6 due to platform bug. Two itimer tests and an interprocess signal test fail on FreeBSD 6 if any test that starts a thread runs before test_signal. Since FreeBSD7 does not show this behavior, the bug is most likely a platform bug, so this patch just skips the failing tests on freebsd6. ........ ................