]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
Issue #12363: improve siginterrupt() tests
authorVictor Stinner <victor.stinner@haypocalc.com>
Fri, 1 Jul 2011 13:24:50 +0000 (15:24 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Fri, 1 Jul 2011 13:24:50 +0000 (15:24 +0200)
commit8d64248c6951aa052e45f39cc7d982f6bbcf5a2c
tree7988cd921d070d088ef662a88d8fd22091e6234f
parent26d318690f37bd43ff843225075eeea633f7da8c
Issue #12363: improve siginterrupt() tests

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().
Lib/test/test_signal.py