'Restore the original SIGCHLD handler and reap processes as long as
there seem to be any remaining.'

def tearDown(self):

    if (self.originalHandler is not None):
        signal.signal(signal.SIGCHLD, self.originalHandler)
    if (process is not None):
        begin = time.time()
        while process.reapProcessHandlers:
            log.msg(('ReactorBuilder.tearDown    reaping    some    processes    %r' % (process.reapProcessHandlers,)))
            process.reapAllProcesses()
            time.sleep(0.001)
            if ((time.time() - begin) > 60):
                for pid in process.reapProcessHandlers:
                    os.kill(pid, signal.SIGKILL)
                raise Exception(('Timeout    waiting    for    child    processes    to    exit:    %r' % (process.reapProcessHandlers,)))
