summaryrefslogtreecommitdiffstats
path: root/Lib/test/signalinterproctester.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-31479: Always reset the signal alarm in tests (#3588)Victor Stinner2017-09-191-4/+7
| | | | | | | | | | | | | * bpo-31479: Always reset the signal alarm in tests Use "try: ... finally: signal.signal(0)" pattern to make sure that tests don't "leak" a pending fatal signal alarm. * Move two more alarm() calls into the try block Fix also typo: replace signal.signal(0) with signal.alarm(0) * Move another signal.alarm() into the try block
* Issue #26566: Rewrite test_signal.InterProcessSignalTestsVictor Stinner2016-03-151-0/+84
* Add Lib/test/signalinterproctester.py * Don't disable the garbage collector anymore * Don't use os.fork() with a subprocess to not inherit existing signal handlers or threads: start from a fresh process * Don't use UNIX kill command to send a signal but Python os.kill() * Use a timeout of 10 seconds to wait for the signal instead of 1 second * Always use signal.pause(), instead of time.wait(1), to wait for a signal * Use context manager on subprocess.Popen * remove code to retry on EINTR: it's no more needed since the PEP 475 * remove unused function exit_subprocess() * Cleanup the code