diff --git a/test/runtime-boundaries.test.ts b/test/runtime-boundaries.test.ts index 1c28a7f..4e84a93 100644 --- a/test/runtime-boundaries.test.ts +++ b/test/runtime-boundaries.test.ts @@ -1194,11 +1194,11 @@ playbooks: try { await writeDocker("process.exit(0);", "setInterval(()=>{},1000);"); const preflightFallback = new AbortController(); - const fallbackTimer = setTimeout(() => preflightFallback.abort(), 500); + const fallbackTimer = setTimeout(() => preflightFallback.abort(), 3_000); fallbackTimer.unref(); try { await expect( - call(Date.now() + 100, preflightFallback.signal), + call(Date.now() + 1_000, preflightFallback.signal), ).rejects.toMatchObject({ code: "VERIFIER_DEADLINE_EXCEEDED" }); } finally { clearTimeout(fallbackTimer); diff --git a/test/runtime-github.test.ts b/test/runtime-github.test.ts index c373a8e..bf31ee6 100644 --- a/test/runtime-github.test.ts +++ b/test/runtime-github.test.ts @@ -79,11 +79,10 @@ Codex can also answer questions or update the PR. Try commenting "@codex address `#!${process.execPath} import {appendFileSync,existsSync,readFileSync} from "node:fs"; const modeUrl=new URL("./mode.json",import.meta.url);const mode=existsSync(modeUrl)?JSON.parse(readFileSync(modeUrl,"utf8")):{}; -const callsUrl=new URL("./calls.log",import.meta.url);const priorCalls=existsSync(callsUrl)?readFileSync(callsUrl,"utf8").trim().split("\\n").filter(Boolean).map(JSON.parse):[]; -appendFileSync(callsUrl,JSON.stringify(process.argv.slice(2))+"\\n"); +const callsUrl=new URL("./calls.log",import.meta.url);const priorCalls=existsSync(callsUrl)?readFileSync(callsUrl,"utf8"):""; if(process.env.GH_TOKEN!==undefined)appendFileSync(new URL("./token.log",import.meta.url),process.env.GH_TOKEN==="scoped-token"?"present\\n":"unexpected\\n"); const args=process.argv.slice(2);const endpoint=args.includes("graphql")?"graphql":args.find((value)=>value.startsWith("repos/"))??args.at(-1)??""; -const endpointCall=priorCalls.filter((call)=>{const priorEndpoint=call.includes("graphql")?"graphql":call.find((value)=>value.startsWith("repos/"))??call.at(-1)??"";return priorEndpoint===endpoint;}).length; +const endpointCall=priorCalls.split(JSON.stringify(endpoint)).length-1;appendFileSync(callsUrl,JSON.stringify(args)+"\\n"); const pull={number:41,node_id:"PR_example",html_url:"https://github.com/example/app/pull/41",state:"open",draft:true,body:"",head:{ref:"mill/task",sha:"${sha}"},base:{ref:"main"},merged:false,merge_commit_sha:null,merged_by:null,merged_at:null}; const listedPull={...pull};delete listedPull.merged;delete listedPull.merged_by;delete listedPull.merged_at; if(endpoint==="user")console.log(JSON.stringify({login:"operator",id:7}));