fix: stabilize ICDB preflight and organize UI into tabs

This commit is contained in:
阿白叔 committed 2026-11-04 17:06:27 +08:00
1 parent 29959e2988
commit 223655fe00
10 files changed
+352 -57

No files matched your search

+20
View File
@@ -90,6 +90,26 @@ def test_requested_close_without_exit_is_not_reported_closed(tmp_path, monkeypat
assert records
@pytest.mark.parametrize('exits', [True, False])
def test_after_owned_close_transient_empty_command_waits_for_exit(tmp_path, monkeypatch, exits):
from types import SimpleNamespace
import win32gui
job, records, messages = startup_fixture(tmp_path, monkeypatch)
ticks = [0.0]
def post(hwnd, message, *_):
messages.append((hwnd, message))
records[0] = (12, '', '', 11) # WMI during process teardown.
def advance(seconds):
ticks[0] += seconds
if exits: records.clear()
monkeypatch.setattr(win32gui, 'PostMessage', post)
monkeypatch.setattr(failed_session, 'time', SimpleNamespace(monotonic=lambda: ticks[0], sleep=advance))
result = failed_session.close_failed_startup(job, 12, timeout_seconds=1)
assert ticks[0] > 0 and len(messages) == 1
assert result['status'] == ('CLOSED' if exits else 'RETAINED')
assert 'STARTUP_PROCESS_UNCONFIRMED' not in result.get('detail', '')
@pytest.mark.parametrize('obstacle', ['address', 'dialog', 'process'])
def test_startup_close_waits_for_native_state_transitions(tmp_path, monkeypatch, obstacle):
from types import SimpleNamespace