Ejemplo n.º 1
0
    def terminate(self):
        """Terminate the worker process and all of its subprocesses."""
        core_log.debug("Ending process %r", self.pid)
        try:
            process = psutil.Process(self.pid)
            kill_process_tree(process)

        except psutil.NoSuchProcess:
            core_log.debug("Process %r not found", self.pid)
Ejemplo n.º 2
0
    def tearDown(self):
        """Cleanup the runner and its workers if they are still alive."""
        active_children()  # Join all done processes.

        core_log.debug("Waiting for runner process to end")
        self.runner_process.join(timeout=self.RUNNER_JOIN_TIMEOUT)

        try:
            core_log.debug("Killing runner process tree")
            process = psutil.Process(self.runner_process.pid)
            kill_process_tree(process)

        except psutil.NoSuchProcess:
            core_log.debug("Process %r not found", self.runner_process.pid)