def _stop(self): # If everything stayed in synch properly, this should never happen. if not self._results_queue.empty(): logger.warning( ("Some results were added after the trial stop condition. " "These results won't be logged.")) # Check for any errors that might have been missed. self._report_thread_runner_error() session.shutdown()
def testSessionInitShutdown(self): self.assertTrue(session._session is None) # Checks that the singleton _session is created/destroyed # by session.init() and session.shutdown() for _ in range(2): # do it twice to see that we can reopen the session session.init(reporter=None) self.assertTrue(session._session is not None) session.shutdown() self.assertTrue(session._session is None)
def cleanup(self): # If everything stayed in synch properly, this should never happen. if not self._results_queue.empty(): logger.warning( ("Some results were added after the trial stop condition. " "These results won't be logged.")) # Check for any errors that might have been missed. self._report_thread_runner_error() session.shutdown() if self.temp_checkpoint_dir is not None and os.path.exists( self.temp_checkpoint_dir): shutil.rmtree(self.temp_checkpoint_dir) logger.debug("Clearing temporary checkpoint: %s", self.temp_checkpoint_dir)
def tearDown(self): session.shutdown() ray.shutdown()