Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions runtime/tests/runtime-signing.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -436,8 +436,10 @@ test("full chain clean -> summarize -> classify verifies with schema using parti
RECEIPT_SIGNING_PRIVATE_KEY_PEM_B64: keys.privatePemB64,
RECEIPT_SIGNING_PUBLIC_KEY_B64: keys.publicRaw32B64,
RECEIPT_SIGNER_ID: "runtime.commandlayer.eth",
VERIFY_SCHEMA_CACHED_ONLY: "0",
SCHEMA_FETCH_TIMEOUT_MS: "50",
VERIFY_SCHEMA_CACHED_ONLY: "1",
VERIFY_MAX_MS: "12000",
SCHEMA_FETCH_TIMEOUT_MS: "3000",
SCHEMA_VALIDATE_BUDGET_MS: "3000",
});

async function runVerb(base, verb, content) {
Expand Down Expand Up @@ -530,11 +532,8 @@ 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
&& verifyAttempt.json?.reason === "validator_not_warmed_yet"
) {
console.log("[chain] verify warmup 202 response", verifyAttempt.json);
if (verifyAttempt.res.status === 202) {
console.log("[chain] verify warmup 202 response", verifyAttempt.json ?? verifyAttempt.text);
await new Promise((resolve) => setTimeout(resolve, 1200));
console.log("[chain] before verify request retry");
verifyAttempt = await verifyReceiptWithTimeout(finalReceipt);
Expand All @@ -545,7 +544,11 @@ test("full chain clean -> summarize -> classify verifies with schema using parti
const verifyJson = verifyAttempt.json;

assert.ok(verifyJson, "verify returned non-JSON response");
assert.equal(verifyRes.status, 200);

if (verifyRes.status !== 200) {
throw new Error(`verify retry failed with status ${verifyRes.status}: ${verifyAttempt.text}`);
}

assert.equal(verifyJson.checks.signature_valid, true);
assert.equal(verifyJson.checks.hash_matches, true);
assert.equal(verifyJson.checks.schema_valid, true);
Expand Down
Loading