Add tests to check that resuming experiments are classified as pending
@@ -315,6 +315,15 @@ class TestExperimentGroupModel(BaseTest):
ExperimentStatusFactory(experiment=experiment, status=ExperimentLifeCycle.RUNNING)
assert experiment_group.pending_experiments.count() == 1
assert experiment_group.running_experiments.count() == 1
+ with patch('runner.schedulers.experiment_scheduler.stop_experiment') as _:
+ ExperimentStatusFactory(experiment=experiment, status=ExperimentLifeCycle.SUCCEEDED)
+ assert experiment_group.pending_experiments.count() == 1
+ assert experiment_group.running_experiments.count() == 0
+ assert experiment_group.succeeded_experiments.count() == 1
+ experiment.resume()
+ assert experiment_group.pending_experiments.count() == 2
+ assert experiment_group.running_experiments.count() == 0
+ assert experiment_group.succeeded_experiments.count() == 0
@tag(RUNNER_TEST)
def test_experiment_group_deletion_triggers_experiments_deletion(self):
