Skip to content
Snippets Groups Projects
Commit beb08359 authored by Daniel Lyons's avatar Daniel Lyons
Browse files

Refresh the execution during resume_execution to avoid using a detached SqlAlchemy instance

parent be1605d2
No related branches found
No related tags found
3 merge requests!1059Catchup 2.7 with main,!1058Draft: Rebase 2.7 on main,!1010Refresh the execution during resume_execution to avoid using a detached SqlAlchemy instance
Pipeline #6154 failed
......@@ -214,6 +214,7 @@ def test_resume_execution(
}
)
fake_execution.capability = capability
mock_capability_info.save_execution(fake_execution)
dummy_execution_manager.queue_execution(fake_execution)
assert fake_execution.queue_state == QueueState.Queued.name
dummy_execution_manager.resume_execution(fake_execution)
......
......@@ -87,6 +87,11 @@ class ExecutionManager(ExecutionManagerIF):
:param execution: the execution whose time has come
"""
# Mark this execution as no longer queued
# this is important for the tests
execution.queue_state = QueueState.Running.name
# load the execution afresh
execution = self.capability_info.lookup_execution(execution.id)
execution.queue_state = QueueState.Running.name
self.capability_info.save_execution(execution)
subject = execution.__json__()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment