Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reset actionrun endtime on recovery #461

Merged
merged 1 commit into from Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions tests/core/recovery_test.py
Expand Up @@ -18,6 +18,7 @@
from tron.core.recovery import filter_recovery_candidates
from tron.core.recovery import launch_recovery_actionruns_for_job_runs
from tron.core.recovery import recover_action_run
from tron.utils import timeutils


class TestRecovery(TestCase):
Expand Down Expand Up @@ -80,11 +81,13 @@ def test_recover_action_run_action_runner(self):
name="test.succeeded",
node=mock_node,
action_runner=action_runner,
end_time=timeutils.current_time()
)
action_run.machine.state = action_run.STATE_UNKNOWN
recover_action_run(action_run, action_runner)
mock_node.submit_command.assert_called_once()
assert action_run.machine.state == action_run.STATE_RUNNING
assert action_run.end_time is None

def test_filter_recoverable_action_runs(self):
assert filter_recoverable_action_runs(self.action_runs) == \
Expand Down
1 change: 1 addition & 0 deletions tron/core/recovery.py
Expand Up @@ -76,6 +76,7 @@ def recover_action_run(action_run, action_runner):
(action_run.id, action_run.machine.state)
)
else:
action_run.end_time = None
action_run.machine.transition('running')

log.info(
Expand Down