"""One-shot watchdog check; administer only the two test processes created here.""" import pathlib,json,subprocess,time,urllib.request D='/usr/bin/docker';ROOT=pathlib.Path('/root/llmuser-gpu-priority-20261110') POLICY=pathlib.Path('/var/lib/llmuser-gpu-policy/status.json') UUID='GPU-6f547b70-7a25-70cb-e134-888402be61e2' NAME='llmuser-priority-validation-watchdog' report={'started_at':time.time(),'passed':False};foreign_id=None;own=None def state():return json.loads(POLICY.read_text()) def record(phase): report['phase']=phase (ROOT/'watchdog-progress.json').write_text(json.dumps(report,indent=2)) print(phase,flush=True) try: record('waiting_for_integration') expected=json.loads((ROOT/'integration-progress.json').read_text())['started_at'] deadline=time.monotonic()+500 while True: r=json.loads((ROOT/'priority-integration.json').read_text()) if r.get('started_at',0)>=expected: assert r['passed'],r.get('error') break assert time.monotonic()