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).
* 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
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).
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).
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().
... 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.
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.
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
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.
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).