]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Set alarms on child processes in process_test.
authorBen Darnell <ben@bendarnell.com>
Sun, 3 Jun 2012 20:28:44 +0000 (13:28 -0700)
committerBen Darnell <ben@bendarnell.com>
Sun, 3 Jun 2012 20:28:44 +0000 (13:28 -0700)
These alarms used to be there, but got dropped in a previous change
because I had assumed the child processes would inherit the parent's
alarm.

tornado/test/process_test.py

index 04bcf161d0042ee5d85e9c3fe12a74e85b486c69..9f7ecf2cf3adda7ad87b40d3d048b53307c80015 100644 (file)
@@ -57,9 +57,11 @@ class ProcessTest(LogTrapTestCase):
             return "http://127.0.0.1:%d%s" % (port, path)
         sockets = bind_sockets(port, "127.0.0.1")
         # ensure that none of these processes live too long
-        signal.alarm(5)
+        signal.alarm(5)  # master process
         try:
             id = fork_processes(3, max_restarts=3)
+            assert id is not None
+            signal.alarm(5)  # child processes
         except SystemExit, e:
             # if we exit cleanly from fork_processes, all the child processes
             # finished with status 0