python/ray/tune/tests/test_ray_trial_executor.py
def testSavePauseResumeErrorRestore(self):
        """Tests that pause checkpoint does not replace restore checkpoint."""
        trial = Trial("__fake")
        self._simulate_starting_trial(trial)

        self._simulate_getting_result(trial)

        # Save
        self._simulate_saving(trial)

        # Train
        self.trial_executor.continue_training(trial)
        self._simulate_getting_result(trial)

        # Pause
        self.trial_executor.pause_trial(trial)
        self.assertEqual(Trial.PAUSED, trial.status)
        self.assertEqual(trial.checkpoint.storage, _TuneCheckpoint.MEMORY)

        # Resume
        self._simulate_starting_trial(trial)

        # Error
        trial.set_status(Trial.ERROR)

        # Restore
        self.trial_executor.restore(trial)

        self.trial_executor.stop_trial(trial)
        self.assertEqual(Trial.TERMINATED, trial.status)
Tests that pause checkpoint does not replace restore checkpoint.
Tests that pause checkpoint does not replace restore checkpoint.
Tests that pause checkpoint does not replace restore checkpoint .
def testSavePauseResumeErrorRestore(self):
        trial = Trial("__fake")
        self._simulate_starting_trial(trial)
        self._simulate_getting_result(trial)
        self._simulate_saving(trial)
        self.trial_executor.continue_training(trial)
        self._simulate_getting_result(trial)
        self.trial_executor.pause_trial(trial)
        self.assertEqual(Trial.PAUSED, trial.status)
        self.assertEqual(trial.checkpoint.storage, _TuneCheckpoint.MEMORY)
        self._simulate_starting_trial(trial)
        trial.set_status(Trial.ERROR)
        self.trial_executor.restore(trial)
        self.trial_executor.stop_trial(trial)
        self.assertEqual(Trial.TERMINATED, trial.status)
def testSavePauseResumeErrorRestore ( self ) : trial = Trial ( "__fake" ) self . _simulate_starting_trial ( trial ) self . _simulate_getting_result ( trial ) self . _simulate_saving ( trial ) self . trial_executor . continue_training ( trial ) self . _simulate_getting_result ( trial ) self . trial_executor . pause_trial ( trial ) self . assertEqual ( Trial . PAUSED , trial . status ) self . assertEqual ( trial . checkpoint . storage , _TuneCheckpoint . MEMORY ) self . _simulate_starting_trial ( trial ) trial . set_status ( Trial . ERROR ) self . trial_executor . restore ( trial ) self . trial_executor . stop_trial ( trial ) self . assertEqual ( Trial . TERMINATED , trial . status )
Tests that pause checkpoint does not replace restore checkpoint.
Tests that pause checkpoint does not replace restore checkpoint .
"""Tests that pause checkpoint does not replace restore checkpoint.""" # Save # Train # Pause # Resume # Error # Restore
self