]> granicus.if.org Git - python/commit
Close #12363: fix a race condition in siginterrupt() tests
authorVictor Stinner <victor.stinner@haypocalc.com>
Mon, 20 Jun 2011 21:28:09 +0000 (23:28 +0200)
committerVictor Stinner <victor.stinner@haypocalc.com>
Mon, 20 Jun 2011 21:28:09 +0000 (23:28 +0200)
commitd628496323bf594679b3d5b3e10d85da8a1c8996
tree0b8b093b87725762bcbd819a01505166694a3c30
parent395dc58ee784087547115b684b2b39f40655ac47
Close #12363: fix a race condition in siginterrupt() tests

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