Running as unit: run-p1718878-i22662643.scope; invocation ID: 210d0e94dee949fa9ab5a5f3ed915455
python3 tests/resilience.py --mode persistence --action-script "./scripts/restart.sh" --base-url "http://127.0.0.1:28206" 
Executing explicit persistence hook; hook output suppressed to avoid leaking secrets.
PASS: persistence preserved confirmed data and existing session. Hook scope needs operator evidence.
1 | import {resolve} from 'node:path';
2 | const root=resolve(import.meta.dir,'..'),base='http://127.0.0.1:28206';
3 | if(Bun.argv.includes('--dry-run')){console.log('Valid isolated two-replica acceptance; no reads or writes');process.exit(0)}
4 | function compose(...args:string[]){const r=Bun.spawnSync([resolve(root,'scripts/compose.sh'),...args],{cwd:root,stdout:'pipe',stderr:'pipe'});if(r.exitCode!==0)throw new Error('isolated compose failed');return new TextDecoder().decode(r.stdout).trim()}
5 | async function call(path:string,method='GET',body?:unknown,token?:string,auth?:string){const r=await fetch(base+path,{method,headers:{'Content-Type':'application/json','Idempotency-Key':crypto.randomUUID(),...(token?{Authorization:'Bearer '+token}:{}),...(auth?{Authorization:auth}:{})},body:body===undefined?undefined:JSON.stringify(body),signal:AbortSignal.timeout(2500)});const b=await r.json();if(!r.ok)throw new Error('HTTP acceptance failed '+r.status);return{body:b,instance:r.headers.get('X-Instance-Id')}}

TypeError: ECONNRESET: The socket connection was closed unexpectedly. For more information, pass `verbose: true` in the second argument to fetch()
  path: "http://127.0.0.1:28206/api/v1/chats/18b90457-28de-4602-bcdd-455a9c681f93/messages",
 errno: 0,
  code: "ECONNRESET"

      at async call (/mnt/data/home/bench-saves/mtuci-vp-remaining-20261115/lab6/student-tests/both-replicas.ts:5:102)

Bun v1.4.4 (Linux x64)
