fix: fence final worker admission against UI shutdown
This commit is contained in:
1 parent
dbc685b9a5
commit
eabf61c73b
13 files changed
+356
-46
No files matched your search
@@ -22,6 +22,7 @@ def project_fixture(tmp_path):
|
||||
|
||||
|
||||
def test_backup_entry_can_open_project_without_layout_data(tmp_path, monkeypatch):
|
||||
import subprocess, sys
|
||||
from cbb_refresh_verify import native_backup as native
|
||||
request, project = project_fixture(tmp_path)
|
||||
executable = tmp_path/'iCDBProjectBackup.exe'; executable.touch()
|
||||
@@ -30,9 +31,12 @@ def test_backup_entry_can_open_project_without_layout_data(tmp_path, monkeypatch
|
||||
monkeypatch.setattr(session_record, 'process_identity', lambda pid:
|
||||
dict(pid=pid, created='fixture', executable='python.exe', owner='fixture'))
|
||||
calls = []
|
||||
monkeypatch.setattr(native.subprocess, 'Popen', lambda command, **kw:
|
||||
(calls.append(command) or SimpleNamespace(pid=123, poll=lambda: None)))
|
||||
session = native.launch_native_backup(request)
|
||||
child = subprocess.Popen([sys.executable,'-c','input()'],stdin=subprocess.PIPE,text=True)
|
||||
monkeypatch.setattr(native.subprocess, 'Popen', lambda command, **kw: (calls.append(command) or child))
|
||||
try:
|
||||
session = native.launch_native_backup(request)
|
||||
finally:
|
||||
child.communicate('\n',timeout=5)
|
||||
record = json.loads(session.job.read_text('utf-8'))
|
||||
assert record['project'] == str(project)
|
||||
assert calls[0][-2] == '--native-backup-worker'
|
||||
|
||||
Reference in new issue
Block a user