diff --git a/runtime/tests/runtime-signing.test.mjs b/runtime/tests/runtime-signing.test.mjs index 55e2ced..fc885f0 100644 --- a/runtime/tests/runtime-signing.test.mjs +++ b/runtime/tests/runtime-signing.test.mjs @@ -438,7 +438,7 @@ test("full chain clean -> summarize -> classify verifies with schema using parti RECEIPT_SIGNER_ID: "runtime.commandlayer.eth", VERIFY_SCHEMA_CACHED_ONLY: "1", VERIFY_MAX_MS: "12000", - SCHEMA_FETCH_TIMEOUT_MS: "3000", + SCHEMA_FETCH_TIMEOUT_MS: "50", SCHEMA_VALIDATE_BUDGET_MS: "3000", }); @@ -532,9 +532,11 @@ test("full chain clean -> summarize -> classify verifies with schema using parti let verifyAttempt = await verifyReceiptWithTimeout(finalReceipt); console.log("[chain] after verify response", verifyAttempt.res.status, verifyAttempt.json ?? verifyAttempt.text); - if (verifyAttempt.res.status === 202) { + const verifyRetryLimit = 2; + for (let attempt = 2; verifyAttempt.res.status === 202 && attempt <= verifyRetryLimit; attempt++) { console.log("[chain] verify warmup 202 response", verifyAttempt.json ?? verifyAttempt.text); - await new Promise((resolve) => setTimeout(resolve, 1200)); + const retryDelayMs = verifyAttempt.json?.retry_after_ms ?? 1200; + await new Promise((resolve) => setTimeout(resolve, retryDelayMs)); console.log("[chain] before verify request retry"); verifyAttempt = await verifyReceiptWithTimeout(finalReceipt); console.log("[chain] after verify response retry", verifyAttempt.res.status, verifyAttempt.json ?? verifyAttempt.text);