def tearDown(self):
        """ Shut down server process. """
        #try:
        for factory in self.factories:
            factory.cleanup()
        for server in self.servers:
            logging.debug('terminating server pid %s', server.pid)
            server.terminate(timeout=10)

        os.chdir(self.startdir)
        if not os.environ.get('OPENMDAO_KEEPDIRS', False):
            try:
                shutil.rmtree(self.tempdir)
            except __HOLE__:
                pass

        # # Cleanup only if there weren't any new errors or failures.
        # if len(self.test_result.errors) == self.n_errors and \
        #    len(self.test_result.failures) == self.n_failures and \
        #    not int(self.keepdirs):
        #     for server_dir in self.server_dirs:
        #         shutil.rmtree(server_dir, onerror=onerror)
        # finally:
        #     os.environ['OPENMDAO_KEEPDIRS'] = self.keepdirs
dataset/ETHPy150Open OpenMDAO/OpenMDAO-Framework/openmdao.main/src/openmdao/main/test/test_distsim.py/TestCase.tearDown