fix: reuse managed desktop across batches with isolated leases
This commit is contained in:
1 parent
d08a940afe
commit
cdbc92fab8
15 files changed
+999
-26
No files matched your search
@@ -107,9 +107,9 @@ def probe(output):
|
||||
candidate = BatchCadRuntime(root, 'fresh_batch', cad_factory=forbidden_cad)
|
||||
with candidate:
|
||||
fresh = candidate._ensure_desktop()
|
||||
assert fresh.name != desktop.name
|
||||
assert fresh.name == desktop.name
|
||||
report['fresh_desktop'] = fresh.name
|
||||
report['events'].append({'phase': 'new_batch', 'blocked': False, 'fresh_desktop_created': True})
|
||||
report['events'].append({'phase': 'new_batch', 'blocked': False, 'managed_desktop_reused': True})
|
||||
restart_code = '''import json,sys
|
||||
from pathlib import Path
|
||||
sys.path.insert(0,sys.argv[2])
|
||||
@@ -121,7 +121,7 @@ assert rows and all(row['state']=='isolated' and row['blocking'] is False for ro
|
||||
assert not blocking_resources(root)
|
||||
with BatchCadRuntime(root,'restart_admission') as runtime:
|
||||
desktop=runtime._ensure_desktop()
|
||||
assert desktop.name != rows[0]['desktop']
|
||||
assert desktop.name == rows[0]['desktop']
|
||||
print(json.dumps({'restart_isolation_validated':True,'fresh_desktop':desktop.name}))
|
||||
'''
|
||||
restarted = subprocess.run((sys.executable, '-c', restart_code, str(root),
|
||||
|
||||
Reference in new issue
Block a user