Ejemplo n.º 1
0
    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()
Ejemplo n.º 2
0
    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)
Ejemplo n.º 3
0
    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)
Ejemplo n.º 4
0
 def tearDown(self):
     session.shutdown()
     ray.shutdown()