| 34 | return Application([("/", ProcessHandler)]) |
| 35 | |
| 36 | def tearDown(self): |
| 37 | if task_id() is not None: |
| 38 | # We're in a child process, and probably got to this point |
| 39 | # via an uncaught exception. If we return now, both |
| 40 | # processes will continue with the rest of the test suite. |
| 41 | # Exit now so the parent process will restart the child |
| 42 | # (since we don't have a clean way to signal failure to |
| 43 | # the parent that won't restart) |
| 44 | logging.error("aborting child process from tearDown") |
| 45 | logging.shutdown() |
| 46 | os._exit(1) |
| 47 | # In the surviving process, clear the alarm we set earlier |
| 48 | signal.alarm(0) |
| 49 | super().tearDown() |
| 50 | |
| 51 | def test_multi_process(self): |
| 52 | # This test doesn't work on twisted because we use the global |