fix: release execution controls after callback failure
This commit is contained in:
1 parent
7da623d055
commit
7bdaaeb2ec
2 files changed
+16
No files matched your search
@@ -854,6 +854,11 @@ class TrialTaskCenterWindow(QMainWindow):
|
|||||||
except Exception as error:
|
except Exception as error:
|
||||||
operation_error = error
|
operation_error = error
|
||||||
self._close_pending = False
|
self._close_pending = False
|
||||||
|
if execution:
|
||||||
|
# A result renderer is part of the worker lifecycle.
|
||||||
|
# If it fails, release the execution controls just as
|
||||||
|
# the service failure path does.
|
||||||
|
self._finish_run()
|
||||||
self.operation_state = self.operation_state.finish(error)
|
self.operation_state = self.operation_state.finish(error)
|
||||||
self._show_error(error)
|
self._show_error(error)
|
||||||
def failed(error):
|
def failed(error):
|
||||||
|
|||||||
@@ -60,6 +60,17 @@ def test_regular_mutation_locks_navigation_until_completion(ui,qtbot):
|
|||||||
ui.open(ui.tasks[1])
|
ui.open(ui.tasks[1])
|
||||||
|
|
||||||
|
|
||||||
|
def test_execution_callback_failure_releases_run_controls(ui,qtbot):
|
||||||
|
w=ui.window
|
||||||
|
w._begin_run(ui.tasks[0].task_id)
|
||||||
|
w._run_async(lambda: 'result', lambda _result: (_ for _ in ()).throw(RuntimeError('render failed')),
|
||||||
|
expected_task_id=ui.tasks[0].task_id)
|
||||||
|
ui.settle()
|
||||||
|
assert w._batch_stop is None
|
||||||
|
assert not w.run_panel.busy_indicator.isVisible()
|
||||||
|
assert not w.run_panel.force_stop_button.isVisible()
|
||||||
|
|
||||||
|
|
||||||
def test_close_during_execution_requests_boundary_pause_and_waits(ui,qtbot):
|
def test_close_during_execution_requests_boundary_pause_and_waits(ui,qtbot):
|
||||||
w=ui.window;started,release=Event(),Event()
|
w=ui.window;started,release=Event(),Event()
|
||||||
def work():
|
def work():
|
||||||
|
|||||||
Reference in new issue
Block a user