fix: harden supervised replacement and missing uid handling
This commit is contained in:
1 parent
656f43e2ff
commit
131b6dbbb3
30 files changed
+1655
-92
No files matched your search
@@ -1,5 +1,6 @@
|
||||
"""UI log and feedback coverage, collectable alongside the service feedback tests."""
|
||||
import json
|
||||
import pytest
|
||||
from dx_productivity.trial_task_center.errors import TaskCenterError
|
||||
from dx_productivity.trial_task_center.ui.messages import (
|
||||
_aligned_log_line, _format_task_log_lines, _nc_sync_log_lines,
|
||||
@@ -54,6 +55,24 @@ def test_preflight_error_keeps_reason_and_stable_id_in_operator_feedback(ui):
|
||||
assert error.error_id in ui.window._log_presenter.log_text
|
||||
|
||||
|
||||
@pytest.mark.parametrize('kind', ['missing', 'invalid', 'forced', 'resources'])
|
||||
def test_supervisor_failure_feedback_keeps_support_id_and_recovery_instruction(ui, kind):
|
||||
from dx_productivity.trial_task_center.supervisor_evidence import MissingSupervisorResult, InvalidSupervisorResult
|
||||
from dx_productivity.trial_task_center.batch_resources import BatchResourceCleanupError
|
||||
errors = {
|
||||
'missing': MissingSupervisorResult(exit_code=79, stderr_tail='worker failed'),
|
||||
'invalid': InvalidSupervisorResult(exit_code=0),
|
||||
'forced': TaskCenterError('user_forced_stop', '已强制结束,请先核验恢复。'),
|
||||
'resources': BatchResourceCleanupError('资源确认失败,请重新清理资源。'),
|
||||
}
|
||||
error = errors[kind]
|
||||
ui.window._show_error(error)
|
||||
text = ui.window.run_panel.operator_band.text()
|
||||
assert error.error_id in text
|
||||
assert error.message in text
|
||||
assert error.error_id in ui.window._log_presenter.log_text
|
||||
|
||||
|
||||
def test_running_feedback_names_owner_and_keeps_navigation_available(ui,qtbot):
|
||||
from threading import Event
|
||||
release,started=Event(),Event()
|
||||
|
||||
Reference in new issue
Block a user